Skip to content

Commit 1010aee

Browse files
committed
WIP
1 parent b15d65b commit 1010aee

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

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

+18-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ name: Deploy-To-Control-Plane-Staging
66
on:
77
# Allows you to run this workflow manually from the Actions tab
88
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
917

1018
# Convert the GitHub secret variables to environment variables for use by the Control Plane CLI
1119
env:
@@ -20,7 +28,16 @@ jobs:
2028
- name: Check out the repo
2129
uses: actions/checkout@v2
2230

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+
2340
- uses: ./.github/actions/deploy-to-control-plane
2441
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 }}
2643
org: ${{ secrets.CPLN_ORG_STAGING }}

0 commit comments

Comments
 (0)