File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,14 @@ name: Deploy-To-Control-Plane-Staging
66on :
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
1119env :
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 }}
You can’t perform that action at this time.
0 commit comments