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

jacoco-report can't find defined token #46

Closed dnedrow closed 1 year ago

dnedrow commented 1 year ago

I'm integrating jacoco-report for the first time and have run into a problem that I can't figure out. It's probably something obvious that I've missed.

I've included the jacoco-report block of my workflow below. When this block runs, the workflow fails and give the following error:

Error: Error: Parameter token or opts.auth is required

Here's the full error for context:

Run madrapps/jacoco-report@v1.4
  with:
    paths: /home/runner/work/consumer-mobile-app-android/consumer-mobile-app-android/FooApp/app/build/coverage-report/report-release.xml
    min-coverage-overall: 40
    min-coverage-changed-files: 60
    update-comment: false
    debug-mode: false
  env:
    BUNDLE_GEMFILE: /home/runner/work/consumer-mobile-app-android/consumer-mobile-app-android/FooApp/Gemfile
    JAVA_HOME: /opt/hostedtoolcache/Java_Corretto_jdk/11.0.19.7.1/x64
    JAVA_HOME_11_X64: /opt/hostedtoolcache/Java_Corretto_jdk/11.0.19.7.1/x64
    GRADLE_BUILD_ACTION_SETUP_COMPLETED: true
    GRADLE_BUILD_ACTION_CACHE_RESTORED: true
Event is pull_request_target
base sha: b3576e4665e4f25c03344d7388599dbbf90f6294
head sha: f4984029b7787a3b53f89da6e1cd9f8b1ff703e6
Error: Error: Parameter token or opts.auth is required
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Add coverage to PR

Does anyone have an idea what I'm missing?

      - name: 📝 Add coverage to PR
        id: jacoco
        uses: madrapps/jacoco-report@v1.4
        with:
          paths: ${{ github.workspace }}/FooApp/app/build/coverage-report/report-release.xml
          token: ${{ secrets.GITHUB_TOKEN }}
          min-coverage-overall: 40
          min-coverage-changed-files: 60
          debug-mode: true
thsaravana commented 1 year ago

@dnedrow Is this your own repository or a forked one? The logs should have token: ***. My guess is the ${{ secrets.GITHUB_TOKEN }} doesn't resolve correctly. If this is indeed not a fork repository, then could you try creating a custom token with write permission and try with that?