3333 - name : Get PR HEAD Ref
3434 if : ${{ github.event_name == 'issue_comment' }}
3535 id : getRef
36- run : echo "PR_REF=$(gh pr view $PR_NUMBER --repo ${{ github.repository }} --json headRefName | jq -r '.headRefName')" >> $GITHUB_OUTPUT
36+ run : echo "PR_REF=$(gh pr view \" $PR_NUMBER\" --repo \" ${{ github.repository }}\" --json headRefName | jq -r '.headRefName')" >> $GITHUB_OUTPUT
3737 env :
3838 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3939
4545
4646 - name : Add GitHub Comment
4747 if : ${{ github.event_name == 'issue_comment' }}
48- uses : actions/github-script@v4
48+ uses : actions/github-script@v6
4949 with :
5050 script : |
5151 github.rest.issues.createComment({
@@ -61,26 +61,24 @@ jobs:
6161 echo "GITHUB_REPOSITORY: \"$GITHUB_REPOSITORY\""
6262 if [ -z "$PR_NUMBER" ]; then
6363 echo "PR_NUMBER is not in the trigger event. Fetching PR number from open PRs."
64- REF=${{ github.ref }}
64+ REF=" ${{ github.ref }}"
6565 REF=${REF#refs/heads/} # Remove 'refs/heads/' prefix
6666 echo "REF: \"$REF\""
67- API_RESPONSE=$(curl --location --request GET "https://api.github.com/repos/$GITHUB_REPOSITORY/pulls?state=open" \
67+ API_RESPONSE=$(curl --location --request GET "https://api.github.com/repos/${ GITHUB_REPOSITORY} /pulls?state=open" \
6868 --header 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}')
69- PR_NUMBER=$(echo $API_RESPONSE | jq '.[] | select(.head.ref=="'$REF'") | .number')
69+ PR_NUMBER=$(echo " $API_RESPONSE" | jq '.[] | select(.head.ref=="'$REF'") | .number')
7070 fi
7171 echo "PR_NUMBER: $PR_NUMBER"
7272 if [ -z "$PR_NUMBER" ]; then
7373 echo "PR_NUMBER is not set. Aborting."
7474 exit 1
7575 fi
76- echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
77-
76+ echo "PR_NUMBER=\"$PR_NUMBER\"" >> $GITHUB_ENV
7877 - name : Get App Name
7978 run : |
8079 echo "PR_NUMBER: ${{ env.PR_NUMBER }}"
81- echo "APP_NAME=qa-react-webpack-rails-tutorial-pr-${{ env.PR_NUMBER }}" >> $GITHUB_ENV
80+ echo "APP_NAME=qa-react-webpack-rails-tutorial-pr-${{ env.PR_NUMBER }}" >> " $GITHUB_ENV"
8281 echo "App Name: ${{ env.APP_NAME }}"
83-
8482 - uses : ./.github/actions/deploy-to-control-plane
8583 with :
8684 app_name : ${{ env.APP_NAME }}
0 commit comments