Skip to content

Commit cfa7789

Browse files
committed
ci: PR OSP dispatcher - collapse batch label-adds into one run via cumulative select + cancel-in-progress
1 parent 8cea9b3 commit cfa7789

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

.github/workflows/pr-osp-select.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ name: PR OSP (label-selected)
22

33
# Run any nightly OSP / sweep job on a PR by adding a label. Add
44
# `ci:<name>` (e.g. ci:hostap) to run that job, or `ci:all` for the
5-
# whole set. Each label add runs only that job, so adding several at
6-
# once gives one clean run per job with no duplication. Re-add a label
7-
# to re-run after a push. workflow_dispatch `jobs` input is the off-PR
5+
# whole set. Add several at once and they all run in ONE workflow run:
6+
# the burst of label events collapses (cancel-in-progress) to a single
7+
# run whose select reads every current ci:* label. Re-add a label to
8+
# re-run after a push. workflow_dispatch `jobs` input is the off-PR
89
# equivalent (space list, or "all").
910

1011
on:
@@ -23,8 +24,8 @@ permissions:
2324
actions: read
2425

2526
concurrency:
26-
group: pr-osp-select-${{ github.ref }}-${{ github.event.label.name }}
27-
cancel-in-progress: false
27+
group: pr-osp-select-${{ github.ref }}
28+
cancel-in-progress: true
2829

2930
jobs:
3031
select:
@@ -34,13 +35,15 @@ jobs:
3435
steps:
3536
- id: p
3637
env:
37-
LABEL: ${{ github.event.label.name }}
38+
LABELS: ${{ join(github.event.pull_request.labels.*.name, ' ') }}
3839
DISPATCH: ${{ github.event.inputs.jobs }}
3940
run: |
4041
sel=""
41-
case "$LABEL" in
42-
ci:*) sel="${LABEL#ci:}" ;;
43-
esac
42+
for l in $LABELS; do
43+
case "$l" in
44+
ci:*) sel="$sel ${l#ci:}" ;;
45+
esac
46+
done
4447
[ -n "$DISPATCH" ] && sel="$sel $DISPATCH"
4548
echo "run= $sel " >> "$GITHUB_OUTPUT"
4649

0 commit comments

Comments
 (0)