Madrapps / jacoco-report

Github action that publishes the JaCoCo report as a comment in the Pull Request
https://github.com/marketplace/actions/jacoco-report
MIT License
144 stars 63 forks source link

Action fails with "HttpError: Resource not accessible by integration" (v1.6.1) #68

Closed osumatu closed 8 months ago

osumatu commented 1 year ago

Hi,

I am trying to use the following action:

  unit-tests:
    name: Unit Tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-java@v1
        with:
          java-version: '17'
      - name: Run tests
        run: |
          mvn verify 

 jacoco-report:
    name: Jacoco Report
    needs: unit-tests
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
      - name: Add coverage to PR
        id: jacoco
        uses: madrapps/jacoco-report@v1.6.1
        with:
          paths: |
            ${{ github.workspace }}/**/target/site/jacoco/jacoco.xml
          token: ${{ secrets.GITHUB_TOKEN }}
          min-coverage-overall: 40
          min-coverage-changed-files: 60

But it keeps failing:

Event is pull_request
base sha: 9d49952b47f76c00181d6f3e98c20df7481c758a
head sha: 556d7e2e1bde94a0c7cb2fe65a090c949467d247
Error: HttpError: Resource not accessible by integration

I see this was reported for a previous version and fixed with the permission but not in my case. PR is opened by me, not by dependabot and I have admin rights for the repository. Any ideas?

smh0300 commented 1 year ago

same problem with me

thsaravana commented 11 months ago

Can you try this:

permissions:
  contents: read
  pull-requests: write
thsaravana commented 10 months ago

If you are still facing this issue, then could you replace the secrets.GITHUB_TOKEN token with your own token with the appropriate permissions?