lucassabreu / comment-coverage-clover

Github Action that automatically adds a comment with a summary of coverage reports (clover)
https://github.com/marketplace/actions/coverage-report-as-comment-clover
15 stars 4 forks source link

Error: this action requires a pull request context to be able to comment https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request #45

Closed lucassabreu closed 10 months ago

lucassabreu commented 10 months ago

from @AnmolSaxenaVodafone at here


I am using the below step to generate a Clover report:

      # Generate Clover Report
      - name: Generate Clover Report
        uses: lucassabreu/comment-coverage-clover@main
        with:
          file: target/site/clover/clover.xml
          with-chart: false

After this commit, I have started getting below exception when I merge the change to the main branch:

Error: this action requires a pull request context to be able to comment
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request Stack: undefined
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Generate Clover Report

Can you advise if the Generate Clover Report step needs to be updated?

lucassabreu commented 10 months ago

hi @AnmolSaxenaVodafone

if you add this to the step the error will vanish: if: ${{ github.event_name == 'pull_request' }}.

i will update the example with this later.

just to explain, this message was added because same users were expecting comments on the commits through the push event and that is not supported yet.

so this message was supposed to alert them.

AnmolSaxenaVodafone commented 10 months ago

hi @AnmolSaxenaVodafone

if you add this to the step the error will vanish: if: ${{ github.event_name == 'pull_request' }}.

i will update the example with this later.

just to explain, this message was added because same users were expecting comments on the commits through the push event and that is not supported yet.

so this message was supposed to alert them.

Thanks @lucassabreu appreciate your quick attention.