← ClaudeAtlas

wire-scheduled-workflowlisted

Use when adding, renaming or debugging a GitHub Actions workflow that carries a `schedule:` or `workflow_dispatch:` trigger — especially in a gitflow repo where workflows land on `develop` first. Fire on "the cron never fired", "the workflow doesn't show up", "dispatch says workflow not found on the default branch", HTTP 404 from `gh workflow run`, or a review of a diff that adds either trigger. Skip for workflows with only `push` / `pull_request` triggers — those run from the pushed ref and have no registration step.
damson/hard-won-skills · ★ 1 · AI & Automation · score 67
Install: claude install-skill damson/hard-won-skills
# Wire a scheduled workflow so it actually runs GitHub registers `schedule` and `workflow_dispatch` only from the copy of the workflow on the **default branch**. A workflow merged to `develop` in a gitflow repo is not registered at all: the cron never fires, `gh workflow list` does not show it, and a dispatch answers `404: workflow not found on the default branch`. Nothing errors — two cron windows can pass before anyone notices. The same applies to a **rename**: the new filename is a new, unregistered workflow until it reaches the default branch. ## Procedure 1. **Name the triggers.** `grep -A5 '^on:' <workflow>`. Only `schedule` and `workflow_dispatch` need registration; `push` / `pull_request` run from the ref that raised the event and work from any branch. 2. **Check registration, don't assume it:** ```bash gh workflow list --all # registered workflows, from the default branch gh workflow run <file>.yml # a 404 here IS the diagnosis ``` 3. **Trace the path to the default branch.** Establish both ends first: ```bash def=$(gh repo view --json defaultBranchRef -q .defaultBranchRef.name) git fetch origin "+refs/heads/$def:refs/remotes/origin/$def" # a stale or # single-branch clone otherwise answers from a tree that isn't there git ls-tree "origin/$def" -- .github/workflows/<file>.yml # empty = not there yet ``` A failed fetch stops the trace — the emptiness of `ls-tree` means nothing against a ref you could n