Authenticate with GitHub token in get-labels action (#10748)

This commit is contained in:
Álvaro Mondéjar Rubio 2024-03-31 17:40:27 +02:00 committed by GitHub
parent f2cdbc3db5
commit 472d89f31d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,6 +5,9 @@ inputs:
issue_number:
description: Issue or pull request number to get labels from
required: true
github-token:
description: GitHub token used to authenticate with the GitHub API
default: ${{ secrets.GITHUB_TOKEN }}
outputs:
labels:
description: Labels of the issue or pull request
@ -15,6 +18,8 @@ runs:
steps:
- id: get-labels
shell: sh
env:
GH_TOKEN: ${{ inputs.github-token }}
run: |
labels="$(gh api 'repos/simple-icons/simple-icons/issues/${{ inputs.issue_number }}' --jq '.labels.[].name' | tr '\n' ',')"
echo "labels=$labels" >> $GITHUB_OUTPUT