GHA/hacktoberfest-accepted: prefer GH_TOKEN

For the `gh` tool, over `GITHUB_TOKEN`. It accepts both, of which
the former seems to be preferred according to the source code and
documentation.

GHA/appveyor-status already uses `GH_TOKEN`.

Closes #17556
This commit is contained in:
Viktor Szakats 2025-06-08 13:02:44 +02:00
parent 0ede81dcc6
commit c347b43e5c
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201

View file

@ -34,7 +34,7 @@ jobs:
- name: Check whether repo participates in Hacktoberfest
id: check
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
gh config set prompt disabled && echo "label=$(
gh repo view --json repositoryTopics --jq '.repositoryTopics[].name' | grep '^hacktoberfest$')" >> "$GITHUB_OUTPUT"
@ -51,7 +51,7 @@ jobs:
- name: Search for Number-based PR references
if: ${{ steps.check.outputs.label == 'hacktoberfest' }}
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
grep -Eo '#([0-9]+)' log | cut -d# -f2 | sort | uniq | xargs -t -n1 -I{} \
gh pr view {} --json number,createdAt \
@ -62,7 +62,7 @@ jobs:
- name: Search for URL-based PR references
if: ${{ steps.check.outputs.label == 'hacktoberfest' }}
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
grep -Eo 'github.com/(.+)/(.+)/pull/([0-9]+)' log | sort | uniq | xargs -t -n1 -I{} \
gh pr view 'https://{}' --json number,createdAt \