File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,14 @@ name: Deploy Review App to Control Plane
6
6
on :
7
7
# Allows you to run this workflow manually from the Actions tab
8
8
workflow_dispatch :
9
+ # inputs:
10
+ # pr_number:
11
+ # description: 'Pull request number'
12
+ # required: false
13
+ # Triggers the workflow on pull request events
14
+ # pull_request:
15
+ # branches:
16
+ # - main # or the branch you want to trigger the workflow
9
17
10
18
# Convert the GitHub secret variables to environment variables for use by the Control Plane CLI
11
19
env :
20
28
- name : Check out the repo
21
29
uses : actions/checkout@v2
22
30
31
+ - name : Extract PR number from branch name
32
+ run : |
33
+ PR_NUMBER=$(echo ${GITHUB_REF#refs/heads/pr-})
34
+ if [ -z "$PR_NUMBER" ]; then
35
+ echo "PR_NUMBER is not set. Aborting."
36
+ exit 1
37
+ fi
38
+ echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
39
+
23
40
- uses : ./.github/actions/deploy-to-control-plane
24
41
with :
25
- app_name : qa-react-webpack-rails-tutorial-pr-${{ github.event.pull_request.number }}
42
+ app_name : qa-react-webpack-rails-tutorial-pr-${{ env.PR_NUMBER }}
26
43
org : ${{ secrets.CPLN_ORG_STAGING }}
You can’t perform that action at this time.
0 commit comments