1
0
mirror of https://github.com/simple-icons/simple-icons.git synced 2024-12-16 01:10:30 +02:00
simple-icons/.github/actions/get-labels/action.yml
2024-03-31 17:40:27 +02:00

26 lines
803 B
YAML

name: Get issue/pull request labels
description: Get the current labels of an issue or pull request through the GitHub API
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
value: ${{ steps.get-labels.outputs.labels }}
runs:
using: composite
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