Commit ca1f781
committed
IONOS(ci): unify concurrency group across push and pull_request runs
Previously the concurrency group used `pr-<num>` for pull_request events
and `<github.ref>` for push events on non-protected branches, so a
`*/dev/*` branch with an open PR produced two parallel runs on every
push: a `push` event run keyed on `refs/heads/<branch>` and a
`pull_request: synchronize` run keyed on `pr-<num>`. Different group
keys meant `cancel-in-progress` never applied between them.
Unify the key to `github.head_ref || github.ref_name` for all non-
protected branches. For pull_request that resolves to the source branch
name; for push it falls back to `ref_name`. Both events now share the
same group and the later-arriving run cancels the older one — in
practice the `pull_request: synchronize` event arrives a few seconds
after `push`, so the PR run wins and remains the PR status check.
Trade-off: `trigger-remote-dev-workflow` is gated to `push` events on
`ionos-dev|ionos-stable|rc/*|*/dev/*`, so it will not fire on dev-branch
pushes while a PR is open from that branch. It still fires on direct
pushes to protected branches (ionos-dev/stable/rc/*), whose group is
keyed per `github.run_id` and therefore never cancels, and on dev-branch
pushes once the PR is closed/merged.
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>1 parent 658c921 commit ca1f781
1 file changed
Lines changed: 8 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
58 | | - | |
59 | 62 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
0 commit comments