wire-scheduled-workflowlisted
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