Skip to content

Commit

Permalink
fix(stage-build): trigger next version of workflow on schedule (#10931
Browse files Browse the repository at this point in the history
)

Ensures that the scheduled stage builds effectively use the workflow from
the `next` branch, even though the schedule runs the `main` version.
  • Loading branch information
caugner authored Apr 16, 2024
1 parent e531d03 commit 9876306
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/stage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,19 @@ permissions:
id-token: write

jobs:
trigger:
runs-on: ubuntu-latest
if: ${{ github.repository == 'mdn/yari' && github.event.schedule != '' }}
steps:
# The schedule runs the `main` version, but we want the `next` version.
- run: gh workflow run "${{ github.workflow }}" --ref "${{ env.DEFAULT_REF }}"

build:
environment: stage
runs-on: ubuntu-latest

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

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

0 comments on commit 9876306

Please sign in to comment.