Repository navigation
Backbot: Skip runs for merged PRs without backport labels - #11166
Merged
Merged
Conversation
Previously, the job ran on every merged PR when the `closed` event fired, whether or not any `backport-to-support/*` label was set. Since we switched to `comment_style: summary`, each of these runs posts a summary comment on the original PR even though there's nothing to backport, which adds noise to every merged PR. Only run the job if the PR has at least one label starting with `backport-to-support/`. The label names are serialized with `toJSON()`, and the search string includes the opening quote so it only matches at the start of a label name. On `labeled` events, still require that the newly added label is a backport label, so adding unrelated labels later doesn't start another run.
julianbrost
approved these changes
Nov 10, 2026
julianbrost
left a comment
Member
There was a problem hiding this comment.
The label names are serialized with toJSON(), and the search string includes the opening quote so it only matches at the start of a label name. This is also the format used in the https://github.com/korthout/backport-action/blob/release-v4/README.md file.
contains(toJSON(github.event.pull_request.labels.*.name), '"backport-to-support/')
What a nasty hack, but there indeed seems to be no better way. 🙃
Member
Author
|
The proof that this PR works as intended is that it didn't post a summary comment here again :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, the job ran on every merged PR when the
closedevent fired, whether or not anybackport-to-support/*label was set. Since we switched tocomment_style: summary, each of these runs posts a summary comment on the original PR even though there's nothing to backport, which adds noise to every merged PR. See #11164 (comment)Only run the job if the PR has at least one label starting with
backport-to-support/. The label names are serialized withtoJSON(), and the search string includes the opening quote so it only matches at the start of a label name. This is also the format used in the https://github.com/korthout/backport-action/blob/release-v4/README.md file.On
labeledevents, still require that the newly added label is a backport label, so adding unrelated labels later doesn't start another run.