Skip to content

Add authoring-github-workflows skill + actionlint CI gate (prevent workflow-YAML breakage) - #760

Merged
YuliiaKovalova merged 6 commits into
dotnet:mainfrom
YuliiaKovalova:skill/github-workflow-authoring
Jun 16, 2026
Merged

Add authoring-github-workflows skill + actionlint CI gate (prevent workflow-YAML breakage)#760
YuliiaKovalova merged 6 commits into
dotnet:mainfrom
YuliiaKovalova:skill/github-workflow-authoring

Conversation

@YuliiaKovalova

Copy link
Copy Markdown
Member

Why

Eval on main broke for every run after #746 merged, with GitHub reporting "This run likely failed because of a workflow file issue" and no jobs starting. Root cause: an unquoted ${{ }} expression in run-name containing #. In YAML, # starts a comment, so the expression was silently truncated to ...format('Evaluate PR — an unterminated ${{. The file still parsed as valid YAML (so yaml.safe_load and review passed), but GitHub Actions rejected it.

This PR makes sure we never see that class of bug again, with two layers:

1. Knowledge — a skill

.agents/skills/authoring-github-workflows/SKILL.md (alongside the existing repo contributor meta-skills like create-skill) documents:

  • The #-as-comment trap and the quoting rule for expression scalars.
  • Other characters that force quoting.
  • Why YAML-only validation (yaml.safe_load, yamllint) is not enough — only actionlint understands the Actions expression grammar.
  • The failure signature ("workflow file issue", no jobs).

2. Enforcement — an actionlint CI gate

.github/workflows/actionlint.yml runs a pinned actionlint on every PR/push that touches .github/workflows/:

  • Lints only hand-authored workflows; generated gh-aw files (DO NOT EDIT headers, e.g. *.lock.yml, agentics-maintenance.yml) are skipped — they're compiled artifacts.
  • Runs with -shellcheck= -pyflakes= so the gate targets workflow/expression correctness, not pre-existing shell/Python style noise.
  • .github/actionlint.yaml declares the repo's custom runner labels (ubuntu-slim, windows-11-arm).

Verification

  • actionlint exits 0 on all 14 hand-authored workflows (including the fixed evaluation.yml).
  • Reverting the quote reproduces got unexpected EOF while lexing end of string literal [expression] and actionlint exits 1 — confirming the gate would have caught the original bug.

Note

This PR is stacked on #759 (the one-line evaluation.yml hotfix) so the new gate is green here. The fix commit is identical, so it merges cleanly whether #759 lands first or this PR does. If you prefer, merge #759 for the urgent fix and this PR for the durable prevention.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

YuliiaKovalova and others added 2 commits June 12, 2026 16:26
…ment

The run-name added in dotnet#746 is an unquoted plain scalar containing
` #{0}`. In YAML, a space followed by '#' starts a comment, so everything
from '#{0} ...' onward was stripped, leaving an unterminated ${{ }}
expression. The file still parses as YAML (yaml.safe_load succeeds) but
GitHub Actions rejects it ("This run likely failed because of a workflow
file issue"), which broke every evaluation run on main after dotnet#746 merged.
Wrapping the value in double quotes keeps the full expression intact;
verified with actionlint.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Prevents the class of bug that broke evaluation on main (dotnet#746): an unquoted
`${{ }}` workflow expression containing `#`, which YAML treats as a comment
and silently truncates, producing a file that parses as YAML but that GitHub
Actions refuses to run ("This run likely failed because of a workflow file
issue", no jobs started).

Two layers:
- Knowledge: .agents/skills/authoring-github-workflows/SKILL.md teaches the
  `#`-as-comment trap and other quoting rules, and to validate with actionlint
  (plain YAML linters accept the truncated form).
- Enforcement: .github/workflows/actionlint.yml runs a pinned actionlint on
  hand-authored workflows for any PR/push touching .github/workflows. Generated
  gh-aw files (DO NOT EDIT headers) are skipped; shellcheck/pyflakes are off so
  the gate focuses on workflow/expression errors. .github/actionlint.yaml
  declares the repo's custom runner labels (ubuntu-slim, windows-11-arm).

Verified locally: actionlint exits 0 on all hand-authored workflows, and
exits 1 on the original unquoted run-name, confirming the gate catches it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 12, 2026 14:41
@github-actions

Copy link
Copy Markdown
Contributor

Note

This PR is from a fork and modifies infrastructure files (eng/ or .github/).

Changes to infrastructure typically need to be submitted from a branch in dotnet/skills (not a fork) so that CI workflows run with the correct permissions and secrets.

Please consider recreating this PR from an upstream branch. If you don't have push access to dotnet/skills, ask a maintainer to push your branch for you.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prevents GitHub Actions workflow-YAML breakage from reaching main by documenting YAML-vs-Actions parsing traps and adding an actionlint CI gate, alongside a targeted fix to evaluation.yml’s run-name expression quoting.

Changes:

  • Quote evaluation.yml’s run-name expression so # can’t be interpreted as a YAML comment.
  • Add an actionlint workflow that lints hand-authored workflows on PRs/pushes.
  • Add actionlint configuration for custom runner labels and a new repository “skill” doc describing safe workflow authoring.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/evaluation.yml Quotes run-name expression to avoid YAML comment truncation.
.github/workflows/actionlint.yml Adds CI gate to lint workflows with actionlint, skipping generated files.
.github/actionlint.yaml Configures actionlint with repo-specific runner labels.
.agents/skills/authoring-github-workflows/SKILL.md Documents common workflow authoring pitfalls and validation steps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/actionlint.yml
Comment thread .github/workflows/actionlint.yml Outdated
Comment thread .agents/skills/authoring-github-workflows/SKILL.md Outdated
@github-actions github-actions Bot added the waiting-on-author PR state label label Jun 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

👋 @YuliiaKovalova — this PR has 3 unresolved review thread(s). When you're ready, please address the feedback and push an update; the triage bot will pick up the next state automatically. (Add the no-stale label to silence further pings.)

@JanKrivanek JanKrivanek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread .agents/skills/authoring-github-workflows/SKILL.md
…ctic-vs-semantic scope

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 16, 2026 09:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/actionlint.yml
Comment thread .github/workflows/actionlint.yml
YuliiaKovalova and others added 2 commits June 16, 2026 11:47
…eds, verify actionlint checksum

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 16, 2026 10:53
@YuliiaKovalova

Copy link
Copy Markdown
Member Author

/evaluate

@github-actions

Copy link
Copy Markdown
Contributor

⏭️ No skills to evaluate — no changed skills with tests were found in this PR. View workflow run

@YuliiaKovalova
YuliiaKovalova merged commit 01b4875 into dotnet:main Jun 16, 2026
36 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

# excluded — they are compiled artifacts, not source we maintain.
to_lint=()
while IFS= read -r f; do
if head -n 30 "$f" | grep -qiE 'DO NOT EDIT|automatically generated|gh aw'; then
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-on-author PR state label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants