Skip to content

Commit 5a4131d

Browse files
committed
fix(ci): add --repo flag to gh commands in release-please workflow
gh CLI has no git repo context in the release-please job (no checkout step), so it cannot auto-detect the repository. Adding --repo $GITHUB_REPOSITORY to all three gh commands resolves the error: 'failed to run git: fatal: not a git repository'
1 parent 3d2c15e commit 5a4131d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ jobs:
2929
run: |
3030
PR_NUMBER=$(echo '${{ steps.release.outputs.pr }}' | jq -r '.number')
3131
PR_BRANCH=$(echo '${{ steps.release.outputs.pr }}' | jq -r '.headBranchName')
32-
gh workflow run ci.yml --ref "$PR_BRANCH"
33-
gh pr review "$PR_NUMBER" --approve --body "Approved by release-please automation."
34-
gh pr merge --auto --merge "$PR_NUMBER"
32+
gh workflow run ci.yml --ref "$PR_BRANCH" --repo "$GITHUB_REPOSITORY"
33+
gh pr review "$PR_NUMBER" --approve --body "Approved by release-please automation." --repo "$GITHUB_REPOSITORY"
34+
gh pr merge --auto --merge "$PR_NUMBER" --repo "$GITHUB_REPOSITORY"

0 commit comments

Comments
 (0)