Skip to content

backport action: run only when the label starts with 'backport'#126825

Merged
domenkozar merged 1 commit intoNixOS:masterfrom
domenkozar:backport-label-check
Jun 19, 2021
Merged

backport action: run only when the label starts with 'backport'#126825
domenkozar merged 1 commit intoNixOS:masterfrom
domenkozar:backport-label-check

Conversation

@domenkozar
Copy link
Member

I haven't tested this, but it looks like it should work.

@domenkozar domenkozar requested review from a team, Mic92 and zowoq as code owners June 14, 2021 11:43
@domenkozar domenkozar mentioned this pull request Jun 14, 2021
1 task
@github-actions github-actions bot added the 6.topic: policy discussion Discuss policies to work in and around Nixpkgs label Jun 14, 2021
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jun 14, 2021
Copy link
Contributor

@blaggacao blaggacao left a comment

Choose a reason for hiding this comment

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

The zeebe docs suggest that the label selector should be done differently.

          ​#​ Optional​
          ​#​ Regex pattern to match github labels​
          ​#​ Must contain a capture group for target branchname​
          ​#​ label_pattern: ^backport

@domenkozar
Copy link
Member Author

The zeebe docs suggest that the label selector should be done differently.

          ​#​ Optional​
          ​#​ Regex pattern to match github labels​
          ​#​ Must contain a capture group for target branchname​
          ​#​ label_pattern: ^backport

That's orthogonal, it allows us to define what label is interpreted as valid backport label. The linked issue will still reproduce.

Copy link
Contributor

@blaggacao blaggacao left a comment

Choose a reason for hiding this comment

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

LGTM

@domenkozar domenkozar merged commit e385834 into NixOS:master Jun 19, 2021
@zowoq
Copy link
Contributor

zowoq commented Jul 25, 2022

@domenkozar

Seems this label condition stopped working at some point, now it is running for every merged PR.

e.g.

#182370
https://github.com/NixOS/nixpkgs/runs/7498116953

@winterqt You may be interested in taking a look at it?

wolfgangwalther added a commit to wolfgangwalther/nixpkgs that referenced this pull request May 4, 2025
The backport job was previously triggered on any label activity, i.e.
when the backport label was already set and a new label added, the
backport would have been triggered again.

That's because github.event_name is actually "pull_request_target" in
this case, not "closed" or "labeled" (the event's types). Thus, this
part of the condition was always true.

This also means that the second part, the startsWith, was never
evaluated. It had its arguments flipped and would have always been
false.

This was introduced in NixOS#126825, but has never really worked as intended.

Resolves NixOS#199556
wolfgangwalther added a commit to wolfgangwalther/nixpkgs that referenced this pull request May 4, 2025
The backport job was previously triggered on any label activity, i.e.
when the backport label was already set and a new label added, the
backport would have been triggered again.

That's because github.event_name is actually "pull_request_target" in
this case, not "closed" or "labeled" (the event's types). Thus, this
part of the condition was always true.

This also means that the second part, the startsWith, was never
evaluated. It had its arguments flipped and would have always been
false.

This was introduced in NixOS#126825, but has never really worked as intended.

Resolves NixOS#199556

(cherry picked from commit b62d9a2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: policy discussion Discuss policies to work in and around Nixpkgs 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants