From 5dc3826bca2c7a9ee85c79465eed4ad325dee200 Mon Sep 17 00:00:00 2001 From: Yun Feng Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] fix: eslint action error in a PR from a fork repo (#943) * fix: eslint action error in a PR from a fork repo error message: 'Resource not accessible by integration' * try to fix the github action error --- .github/workflows/eslint.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 91676387..a9f77369 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -24,13 +24,24 @@ jobs: run: yarn lint:report # Continue to the next step even if this fails continue-on-error: true + - name: Upload ESLint report + uses: actions/upload-artifact@v3 + with: + name: eslint_report.json + path: eslint_report.json + + Annotation: + # Skip the annotation action in PRs from the forked repositories + if: github.event.pull_request.head.repo.full_name == 'rrweb-io/rrweb' + needs: eslint_check_upload + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + with: + name: eslint_report.json - name: Annotate Code Linting Results uses: ataylorme/eslint-annotate-action@v2 with: repo-token: '${{ secrets.GITHUB_TOKEN }}' report-json: 'eslint_report.json' - - name: Upload ESLint report - uses: actions/upload-artifact@v2 - with: - name: eslint_report.json - path: eslint_report.json