diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index bec32fe..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -name: Lint -on: - pull_request: - branches: [main] - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Check for src/pages changes - id: changes - env: - BASE_REF: ${{ github.base_ref }} - run: | - git diff --name-only "origin/${BASE_REF}...HEAD" | grep -q '^src/pages/' \ - && echo "changed=true" >> $GITHUB_OUTPUT \ - || echo "changed=false" >> $GITHUB_OUTPUT - - - name: Lint - id: lint - if: steps.changes.outputs.changed == 'true' - continue-on-error: true - run: npx --yes github:AdobeDocs/adp-devsite-utils runLint -v - - - name: Save PR number - if: always() - env: - PR_NUMBER: ${{ github.event.pull_request.number }} - run: echo "$PR_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 - if-no-files-found: ignore - - - name: Fail if linter found errors - if: steps.changes.outputs.changed == 'true' && steps.lint.outcome == 'failure' - run: exit 1 diff --git a/.github/workflows/post-lint-comment.yml b/.github/workflows/post-lint-comment.yml deleted file mode 100644 index d2c75fd..0000000 --- a/.github/workflows/post-lint-comment.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -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/pr-comment.yml b/.github/workflows/pr-comment.yml new file mode 100644 index 0000000..807bbfe --- /dev/null +++ b/.github/workflows/pr-comment.yml @@ -0,0 +1,17 @@ +--- +name: PR Comment +on: + workflow_run: + workflows: ["PR validation"] + types: + - completed + +permissions: + pull-requests: write + +jobs: + comment: + uses: AdobeDocs/adp-devsite-workflow/.github/workflows/pr-comment-v3.yml@main + with: + run_id: ${{ github.event.workflow_run.id }} + event: ${{ github.event.workflow_run.event }} diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml new file mode 100644 index 0000000..68f2f9b --- /dev/null +++ b/.github/workflows/pr-validation.yml @@ -0,0 +1,11 @@ +--- +name: PR validation +on: + pull_request: + +jobs: + validate: + uses: AdobeDocs/commerce-contributor/.github/workflows/validate-pr.yml@main + with: + base_ref: ${{ github.event.pull_request.base.ref }} + pr_number: ${{ github.event.pull_request.number }}