Skip to content

Commit 9876306

Browse files
authored
fix(stage-build): trigger next version of workflow on schedule (#10931)
Ensures that the scheduled stage builds effectively use the workflow from the `next` branch, even though the schedule runs the `main` version.
1 parent e531d03 commit 9876306

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: .github/workflows/stage-build.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,19 @@ permissions:
6565
id-token: write
6666

6767
jobs:
68+
trigger:
69+
runs-on: ubuntu-latest
70+
if: ${{ github.repository == 'mdn/yari' && github.event.schedule != '' }}
71+
steps:
72+
# The schedule runs the `main` version, but we want the `next` version.
73+
- run: gh workflow run "${{ github.workflow }}" --ref "${{ env.DEFAULT_REF }}"
74+
6875
build:
6976
environment: stage
7077
runs-on: ubuntu-latest
7178

7279
# Only run the scheduled workflows on the main repo.
73-
if: github.repository == 'mdn/yari'
80+
if: ${{ github.repository == 'mdn/yari' && github.event.schedule == '' }}
7481

7582
steps:
7683
# Our usecase is a bit complicated. When the cron schedule runs this workflow,

0 commit comments

Comments
 (0)