33
33
- name : Get PR HEAD Ref
34
34
if : ${{ github.event_name == 'issue_comment' }}
35
35
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
37
37
env :
38
38
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
39
39
45
45
46
46
- name : Add GitHub Comment
47
47
if : ${{ github.event_name == 'issue_comment' }}
48
- uses : actions/github-script@v4
48
+ uses : actions/github-script@v6
49
49
with :
50
50
script : |
51
51
github.rest.issues.createComment({
@@ -61,26 +61,24 @@ jobs:
61
61
echo "GITHUB_REPOSITORY: \"$GITHUB_REPOSITORY\""
62
62
if [ -z "$PR_NUMBER" ]; then
63
63
echo "PR_NUMBER is not in the trigger event. Fetching PR number from open PRs."
64
- REF=${{ github.ref }}
64
+ REF=" ${{ github.ref }}"
65
65
REF=${REF#refs/heads/} # Remove 'refs/heads/' prefix
66
66
echo "REF: \"$REF\""
67
- API_RESPONSE=$(curl --location --request GET "https://github.com/api/repos/$GITHUB_REPOSITORY/pulls?state=open" \
67
+ API_RESPONSE=$(curl --location --request GET "https://github.com/api/repos/${ GITHUB_REPOSITORY} /pulls?state=open" \
68
68
--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')
70
70
fi
71
71
echo "PR_NUMBER: $PR_NUMBER"
72
72
if [ -z "$PR_NUMBER" ]; then
73
73
echo "PR_NUMBER is not set. Aborting."
74
74
exit 1
75
75
fi
76
- echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
77
-
76
+ echo "PR_NUMBER=\"$PR_NUMBER\"" >> $GITHUB_ENV
78
77
- name : Get App Name
79
78
run : |
80
79
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"
82
81
echo "App Name: ${{ env.APP_NAME }}"
83
-
84
82
- uses : ./.github/actions/deploy-to-control-plane
85
83
with :
86
84
app_name : ${{ env.APP_NAME }}
0 commit comments