Describe the feature or problem you’d like to solve
GitHub Actions sets the GITHUB_REPOSITORY environment variable, but gh only reads the GH_REPO environment variable.
This means that workflows using gh without an actions/checkout step have to set the GH_REPO environment variable:
jobs:
- name: Count PRs
env:
GH_REPO: ${{ env.GITHUB_REPOSITORY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr list --json number --jq length
Proposed solution
Read GITHUB_REPOSITORY when GH_REPO is not set, similar to the behavior for {GH,GITHUB}_TOKEN (see: #1229, #2388).
jobs:
- name: Count PRs
env:
- GH_REPO: ${{ env.GITHUB_REPOSITORY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr list --json number --jq length
Describe the feature or problem you’d like to solve
GitHub Actions sets the
GITHUB_REPOSITORYenvironment variable, butghonly reads theGH_REPOenvironment variable.This means that workflows using
ghwithout anactions/checkoutstep have to set theGH_REPOenvironment variable:Proposed solution
Read
GITHUB_REPOSITORYwhenGH_REPOis not set, similar to the behavior for{GH,GITHUB}_TOKEN(see: #1229, #2388).jobs: - name: Count PRs env: - GH_REPO: ${{ env.GITHUB_REPOSITORY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: gh pr list --json number --jq length