-
Notifications
You must be signed in to change notification settings - Fork 2.1k
45 lines (38 loc) · 1.17 KB
/
heroku-review-app-on-label.yml
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
35
36
37
38
39
40
41
42
43
44
45
name: Heroku Review App on label
on:
pull_request:
types: [labeled]
permissions:
contents: read
jobs:
create-review-app:
if: ${{ github.event.label.name == 'create-review-app' }}
runs-on: ubuntu-latest
steps:
- uses: fastruby/[email protected]
with:
action: create
env:
HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }}
HEROKU_PIPELINE_ID: ${{ secrets.HEROKU_PIPELINE_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: fastruby/pr-unlabeler@v1
with:
label-to-remove: "create-review-app"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
destroy-review-app:
if: ${{ github.event.label.name == 'destroy-review-app' }}
runs-on: ubuntu-latest
steps:
- uses: fastruby/[email protected]
with:
action: destroy
env:
HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }}
HEROKU_PIPELINE_ID: ${{ secrets.HEROKU_PIPELINE_ID }}
- uses: fastruby/pr-unlabeler@v1
with:
label-to-remove: "destroy-review-app"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}