-
Notifications
You must be signed in to change notification settings - Fork 3
34 lines (32 loc) · 1.15 KB
/
pr-deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: PR Deploy
on:
issue_comment:
types: [created]
jobs:
slash-command:
name: Slash Command
runs-on: ubuntu-latest
steps:
- uses: xt0rted/slash-command-action@v2
with:
command: deploy
reaction-type: rocket
- id: request
uses: octokit/[email protected]
with:
route: ${{ github.event.issue.pull_request.url }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/github-script@v7
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'deploy.yaml',
ref: '${{ fromJson(steps.request.outputs.data).head.ref }}',
inputs: {
environment: 'staging',
tag: 'pr-${{ github.event.issue.number }}',
}
})