-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Open
Labels
Description
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
Margen67, lwasyl, AnimMouse, CraigSiemens, lalten and 3 more