Conversation
…-121) Scheduled and workflow_dispatch triggers always run from the default branch (main). Checkout of develop happens at step level, but GITHUB_REF_NAME still reflects 'main'. Guard step now checks GITHUB_REF_NAME: - Not 'develop': emit notice and skip all subsequent steps - 'develop' with missing template: fail with error (unchanged behaviour) - 'develop' with template present: proceed normally
This was referenced Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
Sync TryGhost Compose Imagesworkflow runs onscheduleandworkflow_dispatch, both of which always run from the default branch (main). Even though the workflow checks outdevelopat step level,GITHUB_REF_NAMEis stillmain— so any step that checked for the template file on the checked-outdevelopcontent was the wrong signal.Previously the workflow had no guard at all, so it would fail when run from
mainif the template was absent on that branch.Fix
Add a guard step immediately after checkout that checks
GITHUB_REF_NAME:GITHUB_REF_NAME != 'develop'::notice::, setskip=true, all subsequent steps are skippedGITHUB_REF_NAME == 'develop'and template missing::error::,exit 1— this is a real failureGITHUB_REF_NAME == 'develop'and template presentskip=false, sync proceeds normallyAll subsequent steps are conditioned on
steps.verify.outputs.skip != 'true'(in addition to their existinghas_changes == 'true'guards).Closes GHO-121