Describe the bug
Latest gh on GHA at the moment.
https://github.com/cli/cli/releases/tag/v2.63.2 was released 7 days ago.
Steps to reproduce the behavior
- We're trying to add a team reviewer:
on:
pull_request:
types:
- edited
jobs:
job:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- run: gh pr edit "${PR_NUMBER}" --add-reviewer "${REVIEWER_TEAM}"
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
REVIEWER_TEAM: my-org/my-team
PR_NUMBER: ${{ github.event.pull_request.number }}
- The output is:
could not determine current branch: failed to run git: fatal: not a git repository (or any of the parent directories): .git
even though we clearly defined the repository with GH_REPO, so gh should go into auto-detect mode.
- Add a checkout step
- uses: actions/checkout@v4
- The output is:
could not determine current branch: failed to run git: not on any branch
- Configure the checkout step
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- Finally got a proper error message that we need permissions for
organisation.teams -> https://github.com/orgs/community/discussions/113519
Expected vs actual behavior
Expected behavior would be that we're not forced to clone the repo just to get the branch name, which is seemingly not even used in the command.
Describe the bug
Latest
ghon GHA at the moment.https://github.com/cli/cli/releases/tag/v2.63.2 was released 7 days ago.
Steps to reproduce the behavior
even though we clearly defined the repository with GH_REPO, so
ghshould go into auto-detect mode.organisation.teams-> https://github.com/orgs/community/discussions/113519Expected vs actual behavior
Expected behavior would be that we're not forced to clone the repo just to get the branch name, which is seemingly not even used in the command.