| name | github-workflows |
| description | Configure and troubleshoot GitHub Actions workflow files on ok-script app repos: YAML syntax traps (single-line run with :word:, block scalars), diagnosing "Invalid workflow file" / jobs:0 runs that never start, and SonarCloud workflow rules (githubactions:S8544). Use when editing .github/workflows/*.yml, fixing a workflow that fails at parse time, or validating YAML before push. Lessons from ok-end-field PRs #194-#200. |
GitHub Workflows — YAML & File Troubleshooting
Purpose
Pitfalls and verified fixes for .github/workflows/*.yml files: YAML traps that break parsing, how to diagnose workflows that never start, and SonarCloud rules that flag workflow files.
1. YAML traps
--only-binary :all: in single-line run: breaks YAML
run: pip install --only-binary :all: -r requirements-docs.txt
run: 'pip install --only-binary :all: -r requirements-docs.txt'
2. Diagnosing "workflow file issue" / jobs: 0
- When
gh run view <id> shows This run likely failed because of a workflow file issue and the run has 0 jobs, the workflow never started — it's a file-parsing problem, not a step failure.
- Check job count:
gh api repos/<owner>/<repo>/actions/runs/<id>/jobs → jobs: [].
- Locate the offending line from the GitHub UI error (e.g. "error in your yaml syntax on line 52") and fix the YAML, then push to re-trigger.
3. SonarCloud rules on workflow files
S8544 — dependencies not locked
Other workflow rules seen
S8264 / S8233: move read/write permissions from workflow level to job level.
S8541: add --only-binary :all: to pip install.
4. Permission tips
- Workflows that create PRs need
pull-requests: write (plus contents: write for branch pushes).
persist-credentials: false on actions/checkout stops the persisted github.token from overriding later git push credentials (see github-rulesets skill for the full App-token push pattern).