Skip to content

Commit b223dcf

Browse files
committed
ci: run strict-schema via workflow_run after mirror-tarball
Strict schema validation requires tarball + sha256 to be populated, but merge PRs intentionally leave those null (mirror-tarball fills them post-merge). The prior trigger raced with mirror and always failed on main because mirror bot commits dont re-trigger push workflows under GITHUB_TOKEN. Switch strict-main to workflow_run so it runs after mirror-tarball completes successfully on main. The four non-strict jobs still fire on pull_request and push-to-main; they are gated off the workflow_run event to avoid duplicate runs. Observed failure pattern on PR #4 (wheels-seo-suite v2.0.0) and PR #5 (wheels-basecoat + wheels-hotwire v1.0.1). Both had all PR-time checks green, mirror-tarball succeeded, notify-site dispatched correctly, but the push-to-main validate run showed a red strict-main.
1 parent 4cf5653 commit b223dcf

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

.github/workflows/validate.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@ on:
1010
paths:
1111
- "packages/**"
1212
- "schema/**"
13+
# Fire the strict-schema job only after mirror-tarball has populated the
14+
# freshly-merged null entries. See the strict-main job comment for details.
15+
workflow_run:
16+
workflows: ["mirror-tarball"]
17+
types: [completed]
1318

1419
jobs:
1520
schema:
1621
name: JSONSchema validation
22+
if: github.event_name != 'workflow_run'
1723
runs-on: ubuntu-latest
1824
steps:
1925
- uses: actions/checkout@v4
@@ -37,13 +43,22 @@ jobs:
3743
3844
strict-main:
3945
name: Strict schema (tarball + sha256 required)
40-
# Runs only on main. PRs submit with null tarball/sha256; the mirror
41-
# workflow populates them post-merge, after which this re-run on main
42-
# enforces that every version entry is fully materialized.
43-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
46+
# Runs only after mirror-tarball completes on main. Merge PRs submit with
47+
# null tarball/sha256; mirror-tarball populates them and pushes a backfill
48+
# commit. That bot-push doesn't re-trigger push-driven workflows (default
49+
# GITHUB_TOKEN behavior), so we use workflow_run to re-enter here and
50+
# enforce that every version entry is fully materialized.
51+
if: >-
52+
github.event_name == 'workflow_run' &&
53+
github.event.workflow_run.conclusion == 'success' &&
54+
github.event.workflow_run.head_branch == 'main'
4455
runs-on: ubuntu-latest
4556
steps:
4657
- uses: actions/checkout@v4
58+
with:
59+
# Explicit main checkout — default on workflow_run triggers is the
60+
# triggering workflow's head_sha (pre-mirror), which still has nulls.
61+
ref: main
4762

4863
- uses: actions/setup-node@v4
4964
with:
@@ -66,6 +81,7 @@ jobs:
6681
6782
structure:
6883
name: Directory + name consistency
84+
if: github.event_name != 'workflow_run'
6985
runs-on: ubuntu-latest
7086
steps:
7187
- uses: actions/checkout@v4
@@ -94,6 +110,7 @@ jobs:
94110
95111
source-resolvable:
96112
name: source.repo + sourceTag resolve on GitHub
113+
if: github.event_name != 'workflow_run'
97114
runs-on: ubuntu-latest
98115
steps:
99116
- uses: actions/checkout@v4
@@ -122,6 +139,7 @@ jobs:
122139
123140
content-safety:
124141
name: File-type allowlist + size cap
142+
if: github.event_name != 'workflow_run'
125143
runs-on: ubuntu-latest
126144
steps:
127145
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)