Skip to content

Commit f4d323b

Browse files
authored
ci: re-run bundle rebuild when Renovate pushes to a labeled PR (#122)
The rebuild-bundle workflow only fired on the `labeled` event, so a failed rebuild never retried: the label is added once at PR creation, and later Renovate rebases never re-triggered it. On #119 the first rebuild crashed during `pnpm install` (vite-plus-core 0.2.7 missing its rolldown linux binding), and after Renovate rebased to 0.2.8 the stale `dist/` kept failing the "Verify dist is up to date" check until the label was manually re-added. Changes: - Trigger on `synchronize` as well as `labeled`, gated on the `needs-bundle-rebuild` label being present (on the `labeled` event the just-added label is already in the array). - No loop: the run triggered by our own `dist/` push finds no diff and exits without pushing, confirmed by today's no-op follow-up run on #119.
1 parent 6559b71 commit f4d323b

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/rebuild-bundle.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ name: Rebuild action bundle
33
# The `needs-bundle-rebuild` label (Renovate adds it for bumps to deps compiled
44
# into dist/index.mjs, or to the vite-plus bundler) triggers a rebuild of the
55
# bundle and a push of the refreshed dist/, so the "Verify dist is up to date"
6-
# check passes without a manual `vp run build`.
6+
# check passes without a manual `vp run build`. `synchronize` re-runs the
7+
# rebuild when Renovate rebases or pushes to a labeled PR, so a failed or stale
8+
# rebuild gets retried; the run triggered by our own dist/ push finds no diff
9+
# and exits without pushing, so it cannot loop.
710
on:
811
pull_request:
9-
types: [labeled]
12+
types: [labeled, synchronize]
1013

1114
permissions: {}
1215

@@ -17,10 +20,11 @@ concurrency:
1720
jobs:
1821
rebuild:
1922
name: rebuild bundle
20-
# Only for our label, and only same-repo branches we can push back to
23+
# Only for labeled PRs (on the `labeled` event the just-added label is
24+
# already in the array), and only same-repo branches we can push back to
2125
# (Renovate PRs are same-repo; fork PRs can't be pushed to).
2226
if: >-
23-
github.event.label.name == 'needs-bundle-rebuild' &&
27+
contains(github.event.pull_request.labels.*.name, 'needs-bundle-rebuild') &&
2428
github.event.pull_request.head.repo.full_name == github.repository
2529
runs-on: ubuntu-latest
2630
permissions:

0 commit comments

Comments
 (0)