Skip to content

Commit c1dabb9

Browse files
committed
feat: trigger review-app deployment on commenting "/deploy-review-app"
1 parent c7c68d7 commit c1dabb9

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/deploy-to-control-plane-review.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,26 @@ on:
77
# Allows you to run this workflow manually from the Actions tab
88
workflow_dispatch:
99

10-
# Triggers the workflow on pull request events
11-
pull_request:
12-
branches:
13-
- master
10+
# Uncomment these lines to trigger the workflow on pull request events
11+
# pull_request:
12+
# branches:
13+
# - master
14+
15+
# deploy on comment "/deploy-review-app"
16+
issue_comment:
17+
types: [created, edited]
1418

1519
# Convert the GitHub secret variables to environment variables for use by the Control Plane CLI
1620
env:
1721
CPLN_ORG: ${{secrets.CPLN_ORG_STAGING}}
1822
CPLN_TOKEN: ${{secrets.CPLN_TOKEN_STAGING}}
19-
PR_NUMBER: ${{github.event.number}}
23+
# Uncomment this line to use the PR number from the pull requests trigger event (that trigger is commented)
24+
# PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }}
25+
PR_NUMBER: ${{ github.event.issue.number }}
2026

2127
jobs:
2228
deploy-to-control-plane-review:
29+
if: ${{ github.event_name != 'issue_comment' || (github.event.comment.body == '/deploy-review-app' && github.event.issue.pull_request) }}
2330
runs-on: ubuntu-latest
2431

2532
steps:

0 commit comments

Comments
 (0)