Skip to content

Add ability to use check for multiple labels#11

Open
ricardoboss wants to merge 2 commits into
tarides:mainfrom
ricardoboss:features/multi-label
Open

Add ability to use check for multiple labels#11
ricardoboss wants to merge 2 commits into
tarides:mainfrom
ricardoboss:features/multi-label

Conversation

@ricardoboss

Copy link
Copy Markdown

This PR adds the ability to set a labels input, which can override the default "no changelog" label to check.
It accepts a string with labels, separated by commas. I amended the full example in the README.

Since the step that checks runs the bash script is now skipped, I removed the handling for checking whether to skip or not from it.

@Leonidas-from-XIV Leonidas-from-XIV left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is a good idea. I was reading through the source code and I think it would be nice to improve these two things, besides that it is good to go.

Comment thread action.yml
IFS=',' read -ra WANT <<< "${{ inputs.labels }}"
PR_LABELS="${{ join(github.event.pull_request.labels.*.name, ' ') }}"
for w in "${WANT[@]}"; do
if [[ " $PR_LABELS " == *" $w "* ]]; then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this, I'd suggest iterating over PR_LABELS without joining them.

Comment thread fail.sh
# fail if the diff is empty
if git diff --exit-code "origin/${BASE_REF}" -- "${CHANGELOG_FILE}"; then
echo >&2 "User-visible changes should come with an entry in the changelog. This behavior
can be overridden by using the \"no changelog\" label, which is used for changes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect at this point, would need to specify the right labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants