Skip to content

Instantly share code, notes, and snippets.

@mumoshu
Last active May 19, 2020 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mumoshu/1dedc99bf4c2c0324d818d112f871827 to your computer and use it in GitHub Desktop.
Save mumoshu/1dedc99bf4c2c0324d818d112f871827 to your computer and use it in GitHub Desktop.
name: Pull Request ChatOps Template
on:
# https://help.github.com/en/articles/events-that-trigger-workflows#issue-comment-event-issue_comment
issue_comment:
types: [created]
jobs:
example:
name: Example ChatOps command
runs-on: ubuntu-latest
steps:
# Get pull request that the slash comment has been added
- uses: actions/checkout@v1
with:
ref: refs/pull/${{ github.event.issue.number }}/head
- if: startsWith(github.event.comment.body, '/mycommand')
env:
PR_NUM: ${{ github.event.issue.number }}
run: |
.${{ github.event.comment.body }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment