@@ -10,18 +10,31 @@ inputs:
1010 org :
1111 description : ' The org of the app to deploy'
1212 required : true
13+ github_token :
14+ description : ' The GitHub token for authentication'
15+ required : true
1316
1417runs :
1518 using : ' composite'
1619 steps :
1720 - name : Setup Environment
1821 uses : ./.github/actions/setup-environment
1922
20- - name : Set Short SHA
21- id : vars
23+ - name : Get correct commit SHA
24+ id : get_sha
2225 shell : bash
2326 run : |
24- echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
27+ if [[ "$GITHUB_EVENT_NAME" == "issue_comment" ]]; then
28+ PR_SHA=$(gh pr view ${{ env.PR_NUMBER }} --json headRefOid --jq '.headRefOid')
29+ echo "sha=$PR_SHA" >> $GITHUB_OUTPUT
30+ echo "sha_short=${PR_SHA:0:7}" >> $GITHUB_OUTPUT
31+ else
32+ echo "sha=$GITHUB_SHA" >> $GITHUB_OUTPUT
33+ echo "sha_short=${GITHUB_SHA:0:7}" >> $GITHUB_OUTPUT
34+ fi
35+ env :
36+ GITHUB_TOKEN : ${{ inputs.github_token }}
37+ PR_NUMBER : ${{ env.PR_NUMBER }}
2538
2639 # Updated caching step to v3
2740 - uses : actions/cache@v3
@@ -41,13 +54,13 @@ runs:
4154
4255 # Provision all infrastructure on Control Plane.
4356 # app react-webpack-rails-tutorial will be created per definition in .controlplane/controlplane.yml
44- - name : cpflow build-image
57+ - name : Build and deploy
4558 shell : bash
4659 run : |
4760 cpln image docker-login
4861 # Use BUILDKIT_PROGRESS=plain to get more verbose logging of the build
49- # BUILDKIT_PROGRESS=plain cpflow build-image -a ${{ inputs.app_name }} --commit ${{steps.vars .outputs.sha_short}} --org ${{inputs.org}}
50- cpflow build-image -a ${{ inputs.app_name }} --commit=${{steps.vars .outputs.sha_short}} --org=${{inputs.org}}
62+ # BUILDKIT_PROGRESS=plain cpflow build-image -a ${{ inputs.app_name }} --commit ${{steps.get_sha .outputs.sha_short}} --org ${{inputs.org}}
63+ cpflow build-image -a ${{ inputs.app_name }} --commit=${{steps.get_sha .outputs.sha_short}} --org=${{inputs.org}}
5164
5265 - name : Deploy to Control Plane
5366 shell : bash
0 commit comments