Skip to content

Commit c59c8e6

Browse files
[ci] Pass --repo to gh pr view in dependabot auto-merge workflow (#14005)
1 parent 029294d commit c59c8e6

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,16 @@ jobs:
4545
if: steps.meta.outputs.dependency-group == 'workerd-and-workers-types'
4646
env:
4747
PR_NUMBER: ${{ github.event.pull_request.number }}
48+
REPO: ${{ github.repository }}
4849
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4950
run: |
5051
set -euo pipefail
5152
52-
# Pull commits and changed files via the GitHub API.
53-
commits_json=$(gh pr view "$PR_NUMBER" --json commits)
54-
files_json=$(gh pr view "$PR_NUMBER" --json files)
53+
# Pull commits and changed files via the GitHub API. `--repo` is
54+
# required because this workflow runs without `actions/checkout`,
55+
# so `gh` has no git remote to infer the repo from.
56+
commits_json=$(gh pr view --repo "$REPO" "$PR_NUMBER" --json commits)
57+
files_json=$(gh pr view --repo "$REPO" "$PR_NUMBER" --json files)
5558
5659
fail() {
5760
echo "verified=false" >> "$GITHUB_OUTPUT"
@@ -83,7 +86,7 @@ jobs:
8386
8487
# `gh pr view --json commits` doesn't expose signature info, so look
8588
# it up via the REST commit endpoint.
86-
first_verified=$(gh api "repos/${{ github.repository }}/commits/$first_oid" --jq '.commit.verification.verified')
89+
first_verified=$(gh api "repos/$REPO/commits/$first_oid" --jq '.commit.verification.verified')
8790
if [ "$first_verified" != "true" ]; then
8891
fail "first commit (Dependabot) does not have a verified signature"
8992
fi

0 commit comments

Comments
 (0)