From 472d89f31d184ac464bb953f39eb2e20c2ccd0b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar=20Rubio?= Date: Sun, 31 Mar 2024 17:40:27 +0200 Subject: [PATCH] Authenticate with GitHub token in get-labels action (#10748) --- .github/actions/get-labels/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/actions/get-labels/action.yml b/.github/actions/get-labels/action.yml index ce287844..a38367d1 100644 --- a/.github/actions/get-labels/action.yml +++ b/.github/actions/get-labels/action.yml @@ -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