Skip to content

Commit 551545b

Browse files
committed
fix: coderabbit suggestions
1 parent bb7089a commit 551545b

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

.github/workflows/add-comment-on-pr-creation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ jobs:
88
comment-on-pr:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/github-script@v6
11+
- name: Add GitHub Comment for review app instructions
12+
uses: actions/github-script@v6
1213
with:
1314
script: |
1415
github.rest.issues.createComment({

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
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

@@ -45,7 +45,7 @@ jobs:
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://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" \
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

Comments
 (0)