Created
May 23, 2022 10:46
-
-
Save cozzin/b9b8354d1bccb48e238112e2523c3d1f to your computer and use it in GitHub Desktop.
pr comment bot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pull request comment | |
on: | |
issue_comment: | |
types: [created, edited, deleted] | |
jobs: | |
pull_request_comment: | |
if: contains(github.event.comment.html_url, '/pull/') # check if the comments come from pull request, exclude those from issue. | |
runs-on: [macos-latest] | |
steps: | |
- name: Deploy | |
if: contains(github.event.comment.body, '/deploy') # check the comment if it contains the keywords | |
run: | | |
echo start deploy | |
- name: Add deploy comment # https://stackoverflow.com/questions/58066966/commenting-a-pull-request-in-a-github-action | |
if: contains(github.event.comment.body, '/deploy') # check the comment if it contains the keywords | |
uses: actions/github-script@v5 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: '🚀' | |
}) | |
- name: Test | |
if: contains(github.event.comment.body, '/test') # check the comment if it contains the keywords | |
run: | | |
echo start test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment