diff --git a/.github/workflows/build-auto-generated-files.yml b/.github/workflows/build-auto-generated-files.yml new file mode 100644 index 0000000..3ee6368 --- /dev/null +++ b/.github/workflows/build-auto-generated-files.yml @@ -0,0 +1,11 @@ +--- +name: Build Auto-Generated Files +on: + workflow_dispatch: + +jobs: + build-contributors: + name: Build Auto-Generated Files + uses: AdobeDocs/adp-devsite-workflow/.github/workflows/build-auto-generated-files-v2.yml@main + secrets: inherit + \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b7799b2..8181bc6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,5 +1,5 @@ --- -name: Deployment +name: Production Deployment on: push: branches: @@ -26,8 +26,10 @@ on: jobs: deployment: name: Deployment - uses: AdobeDocs/adp-devsite-workflow/.github/workflows/deploy.yml@main + if: github.actor != 'adp-devsite-app[bot]' && github.repository != 'AdobeDocs/dev-docs-template' + uses: AdobeDocs/adp-devsite-workflow/.github/workflows/deploy-v2.yml@main + secrets: inherit with: env: ${{ inputs.env || 'prod' }} baseSha: ${{ inputs.baseSha || '' }} - deployAll: ${{ inputs.deployAll || true }} + deployAll: ${{ inputs.deployAll || false }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..44d6c6b --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,36 @@ +--- +name: Lint +on: + pull_request: + branches: [main] + paths: + - 'src/pages/**' + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Lint + id: lint + continue-on-error: true + run: npx --yes github:AdobeDocs/adp-devsite-utils runLint -v + + - name: Save PR number + if: always() + run: echo "${{ github.event.pull_request.number }}" > pr-number.txt + + - name: Upload linter report + if: always() + uses: actions/upload-artifact@v7 + with: + name: linter-report + path: | + linter-report.txt + pr-number.txt + + - name: Fail if linter found errors + if: steps.lint.outcome == 'failure' + run: exit 1 diff --git a/.github/workflows/post-lint-comment.yml b/.github/workflows/post-lint-comment.yml new file mode 100644 index 0000000..d2c75fd --- /dev/null +++ b/.github/workflows/post-lint-comment.yml @@ -0,0 +1,32 @@ +--- +name: Post Linter Report +on: + workflow_run: + workflows: ["Lint"] + types: + - completed + +permissions: + pull-requests: write + +jobs: + comment: + runs-on: ubuntu-latest + if: github.event.workflow_run.event == 'pull_request' + steps: + - name: Download linter report artifact + uses: actions/download-artifact@v8 + with: + name: linter-report + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Post Linter Report to PR + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_REPOSITORY: ${{ github.repository }} + LINTER_REPORT_PATH: ./linter-report.txt + PR_NUMBER_PATH: ./pr-number.txt + run: | + npm install --no-save github:AdobeDocs/adp-devsite-scripts + node node_modules/adp-devsite-scripts/linter-bot/postLinterReport.js diff --git a/.github/workflows/stage.yml b/.github/workflows/stage.yml index c96a42d..d108f50 100644 --- a/.github/workflows/stage.yml +++ b/.github/workflows/stage.yml @@ -15,7 +15,8 @@ on: jobs: deployment: name: Deployment - uses: AdobeDocs/adp-devsite-workflow/.github/workflows/deploy.yml@main + uses: AdobeDocs/adp-devsite-workflow/.github/workflows/deploy-v2.yml@main + secrets: inherit with: env: stage baseSha: ${{ inputs.baseSha }} diff --git a/.gitignore b/.gitignore index 12be62a..ea0c7aa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +# .gitignore + # OS and IDE generated files .DS_Store .vscode @@ -36,3 +38,22 @@ github_conf # local dev tmp linter-report.txt + +# Added by update-bot +yarn-error.log +.pnp.* +.yarn/* +!.gitignore +!.yarn.lock +!.yarnrc.yml +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions +.actrc +.secrets +local-test.yml +.yalc +yalc.lock +linter-output.txt diff --git a/package.json b/package.json index 305b29e..733986d 100644 --- a/package.json +++ b/package.json @@ -7,23 +7,26 @@ "url": "https://github.com/AdobeDocs/commerce-testing" }, "scripts": { - "dev": "npx --yes github:AdobeDocs/adp-devsite-utils dev", - "buildNavigation": "npx --yes github:AdobeDocs/adp-devsite-utils buildNavigation -v", - "buildRedirections": "npx --yes github:AdobeDocs/adp-devsite-utils buildRedirections -v", - "renameFiles": "npx --yes github:AdobeDocs/adp-devsite-utils renameFiles -v", - "normalizeLinks": "npx --yes github:AdobeDocs/adp-devsite-utils normalizeLinks -v", - "buildSiteWideBanner": "npx --yes github:AdobeDocs/adp-devsite-utils buildSiteWideBanner -v", - "buildSiteMetadata": "npx --yes github:AdobeDocs/adp-devsite-utils buildSiteMetadata -v", - "buildContributors": "npx --yes github:AdobeDocs/adp-devsite-utils buildContributors -v", - "lint": "npx --yes github:AdobeDocs/adp-devsite-utils runLint -v", - "lint:errorOnly": "npx --yes github:AdobeDocs/adp-devsite-utils runLint", - "link:externalLinkOnly": "npx --yes github:AdobeDocs/adp-devsite-utils runLint --external-links-only -v", - "link:checkAllLinks": "npx --yes github:AdobeDocs/adp-devsite-utils runLint --internal-links-only --external-links-only -v", - "redirectCheck:stage": "npx --yes github:AdobeDocs/adp-devsite-utils redirectChecker stage --verbose", - "redirectCheck:prod": "npx --yes github:AdobeDocs/adp-devsite-utils redirectChecker prod --verbose", + "dev": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils dev", + "buildNavigation": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils buildNavigation -v", + "buildRedirections": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils buildRedirections -v", + "renameFiles": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils renameFiles -v", + "normalizeLinks": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils normalizeLinks -v", + "buildSiteWideBanner": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils buildSiteWideBanner -v", + "buildSiteMetadata": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils buildSiteMetadata -v", + "buildContributors": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils buildContributorsV2 -v", + "lint": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils runLint -v", + "lint:errorOnly": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils runLint", + "link:externalLinkOnly": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils runLint --external-links-only -v", + "link:checkAllLinks": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils runLint --internal-links-only --external-links-only -v", + "redirectCheck:stage": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils redirectChecker stage --verbose", + "redirectCheck:prod": "npx --yes --prefer-online github:AdobeDocs/adp-devsite-utils redirectChecker prod --verbose", "lint:md": "npx --yes markdownlint-cli2 'src/pages/**/*.md' '*.md'", "lint:md:fix": "npx --yes markdownlint-cli2 --fix 'src/pages/**/*.md' '*.md'", "test": "npx --yes jest", "test:config": "npx --yes jest tests/config.test.js" + }, + "engines": { + "node": "^24.11.0" } }