StepGleam logoStepGleam
Coding guide

Automate unstructured repo work with GitHub Agentic Workflows

Install gh aw, initialise the repo, have a coding agent write a Markdown workflow, compile it to lock.yml, commit both, and put a drift check in CI so you never ship Markdown without its compiled Actions file.

~40 minIntermediate 82/100 6 steps Updated Oct 29, 2026
GitHub Agentic Workflowsgh aw CLIGitHub Copilot CLI
Automate unstructured repo work with GitHub Agentic Workflows — illustration for this Coding guide

Tools used

Step navigator0/6 done
0 of 6 steps done
What you'll get

A Markdown agentic workflow plus its compiled .lock.yml in .github/workflows/, running on Actions with safe-outputs, and a CI check that fails if the lock file drifts.

Who this is for

Teams with GitHub Actions enabled who need an agent for semi-structured repo work (release notes, triage, docs) that deterministic scripts cannot parse.

Read this first

Before you start

GitHub Agentic Workflows went generally available on 28 October 2026. Nicolas Fränkel (long-time HN account) used them earlier in 2026 to parse unstructured release notes for deprecations that no regex could catch, then reused the same lessons to keep README, wiki, Copilot instructions and changelog in sync. This guide sticks to his write-up and the official docs. Gaps he left (the exact release-notes prompt, the full CI YAML) are left as gaps.

Step-by-step instructions

Step 1 of 6 · Coding

Install the gh aw extension and initialise the repo

Fränkel's kickoff: install the gh aw extension, then run gh aw init (or use the GitHub GUI). Official docs say gh aw init adds skills and instructions so a coding agent can create and edit workflows more effectively.

Copy-ready promptgh aw CLI
gh extension install github/gh-aw && gh aw init
Automate unstructured repo work with GitHub Agentic Workflows — guide thumbnail
Why this works

Without the skills from init, the coding agent has no project-local guidance for this format.

Step 2 of 6 · Coding

Ask a coding agent to create the Markdown workflow with the agentic-workflows skill

Fränkel used Copilot CLI for "development proper." The docs recommend starting your coding agent in the repo and prompting with the agentic-workflows skill, for example a PR reviewer or a daily activity report. The agent creates a Markdown file under .github/workflows/ with YAML frontmatter (on, permissions, safe-outputs, engine) and a natural-language body.

Copy-ready promptGitHub Copilot CLI
/agentic-workflows Create a workflow that reviews each pull request and checks that the changes include enough tests.
Step 3 of 6 · Coding

Compile the Markdown to .lock.yml before you push

Fränkel's first hard lesson: "GitHub doesn't execute the Markdown workflow, but the YAML one." He once pushed only the Markdown and saw no change. Compile with gh aw compile (or gh aw compile my-workflow). Commit both files. Docs say the same: commit the .md and the compiled .lock.yml.

Copy-ready promptgh aw CLI
gh aw compile --validate --strict
Why this works

Actions only sees the compiled YAML; Markdown alone is a silent no-op.

Step 4 of 6 · Coding

Add the engine token the workflow expects

Fränkel: the compiled workflow looks for GITHUB_COPILOT_TOKEN, a fine-grained token with at least Copilot requests permission. Docs add that each engine (Copilot, Claude, Codex, Gemini) needs its own authentication secret in the repository, and Copilot is the default when engine is omitted.

Step 5 of 6 · Coding

Check lock-file drift in CI; do not let a workflow rewrite other workflows

Fränkel first tried a workflow that recompiled agentic workflows on change and hit permission issues. He decided that was a bad idea: "if an attacker manages to control a workflow, they can do whatever the workflow's permissions allow." His next best thing: a CI job that compiles under the same conditions and fails if the result differs from the committed lock files. On Windows vs Ubuntu he also needed a proper .gitattributes file for line endings.

Why this works

A failing drift check catches a forgotten compile without giving the pipeline write access to workflow files.

Step 6 of 6 · Coding

Pick a use case deterministic scripts cannot handle

Fränkel's winning case was upgrade-impact config files: some deprecations lived in code (@Deprecated, custom annotations), but plugin deprecations lived only in unstructured release notes. "I can't use standard deterministic automations. Release notes don't have a regular structure." After that worked, he got continuous documentation working too: every relevant change opens a PR updating README, wiki, Copilot instructions.md and the changelog. He did not publish the exact system prompt for the release-notes job beyond GitHub's sandbox policy block.

Why this works

Agents earn their keep on semi-structured text; keep regex for the structured half.

End of guide · Reviewed Oct 29, 2026

Pro tips2
  • Commit both the .md and the .lock.yml; Actions runs the YAML, not the Markdown.
  • Keep write operations behind safe-outputs such as create-issue or create-pull-request.
Common mistakes2
  • Pushing only the Markdown and wondering why nothing runs.
  • Letting a workflow rewrite other workflows automatically; Fränkel hit permission walls and later called that a bad idea for security.
FAQ2
Do I need Copilot?
The default engine is Copilot and needs a Copilot license plus a fine-grained token with Copilot requests permission. The docs also list Claude, Codex and Gemini as engines with their own secrets.
Can I use Marketplace actions inside an agentic workflow?
Fränkel reports you cannot; basic jobs such as opening a PR have to be reinvented or done through safe-outputs.