Skip to content

Backbot: Skip runs for merged PRs without backport labels - #11166

Merged
yhabteab merged 1 commit into
masterfrom
backbot-summary-fix
Nov 10, 2026
Merged

yhabteab merged 1 commit into
masterfrom
backbot-summary-fix

Conversation

@yhabteab

@yhabteab yhabteab commented Nov 9, 2026

Copy link
Copy Markdown
Member

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. 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 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.

On labeled events, still require that the newly added label is a backport label, so adding unrelated labels later doesn't start another run.

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.
@yhabteab
yhabteab requested a review from julianbrost November 9, 2026 15:45
@cla-bot cla-bot Bot added the cla/signed label Nov 9, 2026
@yhabteab yhabteab added this to the 2.17.0 milestone Nov 9, 2026
@yhabteab yhabteab added the github_actions Pull requests that update GitHub Actions code label Nov 9, 2026

@julianbrost julianbrost 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.

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. 🙃

@yhabteab
yhabteab merged commit 19400e6 into master Nov 10, 2026
28 checks passed
@yhabteab
yhabteab deleted the backbot-summary-fix branch November 10, 2026 16:11
@yhabteab

Copy link
Copy Markdown
Member Author

The proof that this PR works as intended is that it didn't post a summary comment here again :)

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

Labels

cla/signed github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants