Skip to content

workflows: Add agent/working label via frontmatter jobs: - #31

Merged
cgwalters merged 1 commit into
mainfrom
working-label
Jul 30, 2026
Merged

cgwalters merged 1 commit into
mainfrom
working-label

Conversation

@cgwalters

Copy link
Copy Markdown
Member

Adds an agent/working label to the issue/PR for the duration of a
drafter/fix/review run, applied and removed by dedicated jobs declared
directly in each workflow's frontmatter jobs: block.

This supersedes #29, which implemented the same behavior by hand-editing
the compiled .lock.yml output directly. That's a dead end: .lock.yml
files are regenerated from the .md sources on every gh aw compile, so
the next recompile of any of these three workflows would have silently
reverted the hand-edit with no error. #29 has been closed in favor of this
PR.

See #24.

How it works

  • add_working_label depends on pre_activation. gh-aw's compiler
    automatically threads any custom job with a pre_activation (rather than
    activation) dependency into activation's own needs, so agent
    (which already needs activation) transitively waits for the label to
    be applied first, with no extra wiring needed.
  • remove_working_label depends on the same job set conclusion itself
    depends on (activation, agent, detection, safe_outputs), with
    if: always(), so it runs even if the agent job fails or times out. It
    can't depend on conclusion directly — gh-aw's compiler unconditionally
    makes conclusion depend on every other job in the workflow, so that
    would create a needs cycle.
  • Both jobs are plain GitHub Actions steps using the same GitHub App token
    pattern as merge.yml, not safe-outputs: safe-outputs handlers only run
    when the agent job succeeds, which can't guarantee the label gets removed
    on failure.

Also creates the agent/working label on the repo and updates the setup
checklist / design-notes section of README.md.

Assisted-by: Claude Sonnet 5 [email protected]

PR #29 implemented this by hand-editing the compiled .lock.yml output
directly, which is a dead end: .lock.yml files are regenerated from
the .md sources on every `gh aw compile`, so the next recompile of any
of these three workflows would silently revert the hand-edit with no
error. See #24.

gh-aw supports this natively: a custom job in frontmatter that depends
on pre_activation (rather than activation) gets automatically threaded
into activation's own needs by the compiler, so agent - which already
depends on activation - transitively waits for it without any extra
wiring. add_working_label uses this to apply the label right after the
membership/permission gate passes. remove_working_label depends
directly on the same jobs conclusion itself depends on (activation,
agent, detection, safe_outputs) with `if: always()`, since gh-aw's
compiler unconditionally makes conclusion depend on every other job
in the workflow - a custom job that itself needs conclusion would
create a needs cycle.

Both jobs use plain GitHub Actions steps with the same GitHub App
token pattern as merge.yml, not safe-outputs: safe-outputs handlers
only run when the agent job succeeds, which can't guarantee the label
is removed on agent failure or timeout.

Also make add_working_label best-effort (|| true), matching
remove_working_label, so a transient labeling failure never blocks
the actual agent run.

Assisted-by: Claude Sonnet 5 <[email protected]>
@cgwalters
cgwalters merged commit 6959426 into main Jul 30, 2026
9 checks passed
@cgwalters
cgwalters deleted the working-label branch July 30, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant