-
Notifications
You must be signed in to change notification settings - Fork 108
feat: mode to delete comment #239
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
Conversation
bc1726c to
e4b3a14
Compare
8a734bf to
b270427
Compare
04e043a to
ae899d0
Compare
|
Current branch is |
Comment Pull Request - GitHub ActionsWhat is it ?A GitHub action that comments with a given message the pull request linked to the pushed branch. UsageClassic usageon: pull_request
jobs:
example_comment_pr:
runs-on: ubuntu-latest
name: An example job to comment a PR
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Hello world ! :wave:Comment a file contentThanks to the - name: PR comment with file
uses: thollander/actions-comment-pull-request@v2
with:
filePath: /path/to/file.txtSetting reactionsYou can also set some reactions on your comments through the - name: PR comment with reactions
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Hello world ! :wave:
reactions: eyes, rocketSpecifying which pull request to comment onYou can explicitly input which pull request should be commented on by passing the ...
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Hello world ! :wave:
pr_number: 123 # This will comment on pull request #123Update a commentEditing an existing comment is also possible thanks to the Thanks to this parameter, it will be possible to identify your comment and then to upsert on it. That is particularly interesting while committing multiple times in a PR and that you just want to have the last execution report printed. It avoids flooding the PR. ...
- name: Comment PR with execution number
uses: thollander/actions-comment-pull-request@v2
with:
message: |
_(execution **${{ github.run_id }}** / attempt **${{ github.run_attempt }}**)_
comment_tag: executionNote: the input InputsAction inputs
PermissionsDepending on the permissions granted to your token, you may lack some rights. permissions:
pull-requests: write Add this in case you get ContributingBuildThe build steps transpiles the $ npm run build |
|
Content of file referenced with absolute path |
|
@thollander Anyway, thanks for this feature! |
I think I misunderstood this feature then. So basically it would create a comment whose lifetime is limited to the job duration from where it's created? |
Add support for
deletemode.It basically runs a post action that will check if a comment needs to be deleted at the end of the job.
(docs: https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runspost)
Usage example :
Closes #232