Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github actions bot not creating any comments #70

Closed
frankwuyue opened this issue Sep 15, 2023 · 4 comments · Fixed by #144
Closed

github actions bot not creating any comments #70

frankwuyue opened this issue Sep 15, 2023 · 4 comments · Fixed by #144

Comments

@frankwuyue
Copy link

I am running this action at debug mode and the log seems like everything is ok. but the github actions bot doesn't appear to comment on my pr.
I am using a forked repo and created a pr to the forked repo, is that the problem? I think github actions' permissions are set to max privileges.

Event is push
passEmoji: :green_apple:
failEmoji: :x:
base sha: 9c991c2e99336d4b83b9a7c2e36ad3a766f9432a
head sha: a2ccfb03a73bc769fd5[17](xxxxx/actions/runs/439360/jobs/1151252#step:8:18)df31d41995ef9072961
....

Resolved files: ....
project: {
    "modules": [],
    "isMultiModule": true,
    "overall": {
        "covered": xxx,
        "missed": xxx,
        "percentage": xxx
    },
    "changed": {
        "covered": 0,
        "missed": 0,
        "percentage": null
    },
    "coverage-changed-files": 100
}
skip: false
prNumber: undefined
@volodia-chornenkyy
Copy link

volodia-chornenkyy commented Nov 1, 2023

Same story for me on a regular private repo.

Using these steps as a workaround:

      # region workaround for madrapps/jacoco-report
      # from https://github.com/marketplace/actions/delete-pr-review-comments
      - uses: aki77/delete-pr-comments-action@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          bodyContains: |-
            [Coverage(%)]

      # from https://github.com/mshick/add-pr-comment
      - uses: mshick/add-pr-comment@v2
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          message: |
            | Area  | Coverage(%) |
            | ------------- | ------------- |
            | **Overall**  | ${{(steps.jacoco.outputs.coverage-overall)}}  |
            | **Changed Files**  | ${{(steps.jacoco.outputs.coverage-changed-files)}}  |
          refresh-message-position: true
      # endregion

@omatuschin
Copy link

Notice the message "prNumber: undefined" in the debug output. The PR is unknown because the workflow was triggered by a push. Change the workflow trigger to "pull_request" instead and it will work.

@thsaravana
Copy link
Member

This #144 should enable "adding comment to pull_request, for a push event. If this is not what you want, then you can also provide the pr-number as an input, and the comment will be added to that Pull Request.

@thsaravana
Copy link
Member

This is now available in v1.7.2-alpha. We will release v1.7.2 in the coming weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants