Skip to content

Commit 5999268

Browse files
committed
Incorporate PR comments
* Add curly braces to the PR_URL variable since this is more conventional and safer bash * Add line separation to the if/else block to make the test command and statements more distinct
1 parent 868463d commit 5999268

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/dependabot-auto-approve.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,14 @@ jobs:
8484
- uses: actions/checkout@v4
8585
- name: Approve a PR if not already approved
8686
run: |
87-
gh pr checkout "$PR_URL" # sets the upstream metadata for `gh pr status`
87+
# Sets the upstream metadata for `gh pr status`
88+
gh pr checkout {"$PR_URL"}
89+
8890
if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" != "APPROVED" ];
89-
then gh pr review --approve "$PR_URL"
90-
else echo "PR already approved, skipping additional approvals to minimize emails/notification noise.";
91+
then
92+
gh pr review --approve "$PR_URL"
93+
else
94+
echo "PR already approved, skipping additional approvals to minimize emails/notification noise.";
9195
fi
9296
env:
9397
PR_URL: ${{github.event.pull_request.html_url}}

0 commit comments

Comments
 (0)