Skip to content

workflows: name the environment with deployment: false - #852

Merged
max-sixty merged 1 commit into
mainfrom
maintain
Aug 5, 2026
Merged

max-sixty merged 1 commit into
mainfrom
maintain

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

GitHub files a deployment record for every job that names an environment, and files it against whatever the run belongs to. Under pull_request_target that is the PR's own head, so since 0.1.13 put environment: tend on the generated workflows, every push to every PR in an adopter repo grows a " deployed to tend" line in its timeline. worktrunk collected 74 records on the first day, four of them on a single PR.

The environment is a secret scope, not a deploy target. deployment: false says so: GitHub files no record, and the branch policy still gates the job.

That last clause is the one worth doubting, since dropping the record could as easily have dropped the check that files it, so it was probed against live GitHub rather than read off the docs.

Probe: same environment, same main-only policy, with and without the property

A gated environment holding PROBE_SECRET, branch policy admitting only main, and two jobs differing solely in the property.

secret on an admitted ref excluded ref deployment record
environment: gated yes refused filed
environment: {name: gated, deployment: false} yes refused none

On main the deployment: false job reported GITHUB_REF=refs/heads/main and HAS_SECRET=yes len=24. On a feature branch it failed with zero steps executed:

Branch "nodeploy-branch" is not allowed to deploy to gated due to environment protection rules.

The control job without the property failed identically and filed a record; the deployment: false job filed none, on either ref.

The block moves into an environment() macro so the seven call sites cannot drift apart, and test_operational_secrets_imply_environment asserts the whole block rather than just the name — dropping deployment: false leaves the gate working and costs only PR noise, so nothing else would catch it.

actionlint learned the key in v1.7.12, so the pre-commit pin moves up from v1.7.10. An adopter pinning an older actionlint will flag their regenerated workflows until they bump; worktrunk runs no actionlint and prql is already on v1.7.12.

This repo's own generated tend-*.yaml still carry the string form. They regenerate from the published tend after the next release, as usual — which is also when the fix reaches adopters.

This was written by Claude Code on behalf of max-sixty

GitHub files a deployment record for every job that names an
environment, and files it against whatever the run belongs to — under
`pull_request_target` that is the PR's own head, so since 0.1.13 every
push to every PR in an adopter repo grew a "<bot> deployed to tend"
line in its timeline. worktrunk collected 74 of them on the first day.

The environment is a secret scope, not a deploy target. `deployment:
false` says so: the record is not filed and the gate is unchanged.
Checked against live GitHub rather than assumed, since dropping the
record could as easily have dropped the check that files it — with the
property set, a job on an admitted ref still receives the environment's
secrets, and one on an excluded ref is still refused before its first
step with `Branch "x" is not allowed to deploy to <env> due to
environment protection rules`.

The block moves into an `environment()` macro so the seven call sites
cannot drift apart, and the invariant test asserts the whole block
rather than the name: dropping `deployment: false` leaves the gate
working and shows up only as noise on a PR, so nothing else would
catch it.

actionlint learned the key in v1.7.12, so the pin moves up from
v1.7.10. Adopters pinning an older actionlint will flag the
regenerated workflows until they bump.

This repo's own generated workflows still carry the old form; they
regenerate from the published tend after the next release, as usual.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit ee1949f into main Aug 5, 2026
4 of 6 checks passed
@max-sixty
max-sixty deleted the maintain branch August 5, 2026 18:44
max-sixty added a commit that referenced this pull request Aug 6, 2026
Bumps the generator to 0.1.14, syncs the lockfile, and adds the CHANGELOG section the release workflow publishes verbatim as the GitHub Release notes.

12 commits since 0.1.13. The release's substance is the deployment-record fix and the environment checks around it. Generated workflows now name the environment as `{name: tend, deployment: false}`, so a job stops filing a deployment record against whatever run it belongs to — under `pull_request_target` that record landed on the PR's own head, so every push to every PR grew a `<bot> deployed to tend` line in its timeline. The branch policy that gates the operational secrets is untouched, and `tend check` grows an `environment-deployments` check that refuses a job naming the environment without the property (#852, #853). Separately, `tend check` widens its environment sweep from secret-holding to credential-holding: an environment counts if it stores a secret or a job requesting `id-token: write` deploys to it, and a ref policy no longer counts as a gate under a trigger a write-scoped actor can steer (#815).

Four silent failures on the agent's own paths are fixed. `tend-mention` reduced its engagement counts inside a `--paginate`d `--jq`, so past one page the numeric guard errored and the bot went quiet on the threads it had engaged with most (#840). The `review` skill counted synthetic reply containers as reviews, which advanced the incremental past unreviewed commits and discarded formed reviews at the close-out (#835). The review's second pass returned a tool-use error because the built-in `/code-review` carries `disable-model-invocation`, and now runs a tend-owned skill that the Codex harness resolves too (#819). And `mark-notification-read` turned a successful run red on a transient API error (#843).

After this tags, adopters pick the changes up on their next nightly regen; tend's own workflows are regenerated in the follow-up PR the release runbook's last step calls for.

Testing: 336 tests pass, `pre-commit run --all-files` is clean, and the release workflow's `awk` extraction was run against the new `## 0.1.14` section locally to confirm the GitHub Release job will find its notes.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty pushed a commit to max-sixty/worktrunk that referenced this pull request Aug 7, 2026
Automated nightly regeneration of tend's workflow files.

**tend version:** 0.1.13 → 0.1.14

## Notable changes

- **Jobs now name the `tend` environment with `deployment: false`**
(max-sixty/tend#852), so GitHub stops filing a deployment record per run
and posting it on the pull request. This is what the current `tend
check` flags as `environment-deployments` (#3729) — regenerating clears
it, and max-sixty/tend#853 makes `check` refuse the old shape going
forward.
- **`id-token: write` dropped from every tend job** — a side effect of
removing the claude-smoke workflow and its `tend-manual` environment
(max-sixty/tend#820). None of the remaining jobs use OIDC, so the
permission was unused.
- **`tend-mention` counts bot engagement outside `jq`**
(max-sixty/tend#840). `gh api --paginate` applies `--jq` once per page,
so `| length` emitted one count per page; past 100 comments the shell
variable held `100\n7`, the numeric test errored, and the bot fell
through to `should_run=false` — going quiet on exactly its most-engaged
threads.
- **Review and triage skill fixes** — the review-record guards now
ignore synthetic reply containers (max-sixty/tend#835), `/code-review`
is ported into a tend-owned skill (max-sixty/tend#819), and triage
substitutes the real issue number into its PR-body templates instead of
leaving a placeholder (max-sixty/tend#844).
- **Outage reporting is more robust** — a stranded outage row now names
the trigger it points at (max-sixty/tend#823), and marking a
notification read tolerates a transient run-metadata fetch failure
(max-sixty/tend#843).

Full compare: max-sixty/tend@0.1.13...0.1.14

Co-authored-by: worktrunk-bot <[email protected]>

This branch had an error being deployed

1 failed deployment
tend — fbacac5c Deployed Aug 5, 2026 by max-sixty via review #1096
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