Last active
May 9, 2021 07:18
-
-
Save xt0rted/55025ea044815d3005b669ac5c04d633 to your computer and use it in GitHub Desktop.
GitHub Actions issue comment workflows
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: Check comments for /commands | |
on: | |
issue_comment: | |
types: [created] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: write | |
deployments: write | |
steps: | |
- name: Check for /deploy command | |
uses: xt0rted/slash-command-action@v1.1.0 | |
id: command | |
continue-on-error: true | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
command: deploy | |
reaction: true | |
reaction-type: rocket | |
allow-edits: false | |
permission-level: admin | |
- name: Get pull request branch | |
uses: xt0rted/pull-request-comment-branch@v1.3.0 | |
if: steps.command.outputs.command-name == 'deploy' | |
id: comment-branch | |
- name: Start deployment | |
uses: bobheadxi/deployments@v0.5.2 | |
if: steps.command.outputs.command-name == 'deploy' | |
with: | |
step: start | |
# Using GITHUB_TOKEN prevents `deployment` workflows from triggering so a PAT is needed | |
token: ${{ secrets.DEPLOYMENT_TOKEN }} | |
env: production | |
no_override: false | |
ref: ${{ steps.comment-branch.outputs.head_ref }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment