Skip to content

Fix release activation cleanup after repository checkout - #15860

Merged
lpcox merged 1 commit into
mainfrom
lpcox-workflow-failure-diagnosis-b06
Nov 1, 2026
Merged

lpcox merged 1 commit into
mainfrom
lpcox-workflow-failure-diagnosis-b06

Conversation

@lpcox

@lpcox lpcox commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes the activation failure in release run 41351204255.

The generated workflow checked out github/gh-aw into the repository workspace, ran ./actions/setup, then checked out github/gh-aw-mcpg into the same directory. That second checkout deleted the local action definition, so Post Setup Scripts failed before any tests, tag creation, or release jobs could run.

  • Regenerate release.lock.yml in release action mode, replacing all five local setup references with github/gh-aw/actions/setup@5fec33b64e8f9159001970542a8357293ca5b09a and removing the colliding runtime checkouts.
  • Pin the same gh-aw revision recorded in the failing run, rather than upgrading runtime behavior. Actions stores remote action definitions outside the repository checkout, preserving their post hooks.
  • Add TestReleaseWorkflowUsesPinnedRemoteActions and document the exact regeneration command in CONTRIBUTING.md.

The authored release workflow and prompt are unchanged. Release triggers, role checks, build/test/tag/release sequencing, credential destinations, engine version, and container/firewall pins are preserved. The generated pre-activation job drops its checkout-only contents: read permission because that checkout is no longer needed.

Verification

  • go test . -run TestReleaseWorkflowUsesPinnedRemoteActions -count=1 passed; the same regression test failed against the original broken lock in an isolated local fixture.
  • make agent-finished completed with ✓ All agent-finished checks passed!.
  • Normal pinned-action compilation succeeded with three existing advisories: prompt temporary paths, dispatch concurrency, and intentional credential persistence for tag pushing.
  • Dry-run compilation was blocked by the release workflow's existing authored host steps; no diagnostic lock was emitted and no release was dispatched. The dry-run source check also reported existing advisories. Docker scanners were not run.
  • Native actionlint reported the same nine findings before and after the fix: unsupported newer Actions syntax/permissions and existing tag-script ShellCheck notes. No new findings were added; this is not a clean actionlint pass.

Security review

One read-only review of the generated lock, pin cache, regression test, contributor guidance, and immutable runtime entrypoints passed all ten scope/provenance/credential/access-control questions. No confirmed vulnerabilities found. The dependency is pinned to the previously executed revision; permissions are not broadened and firewall protections are unchanged.

No authored workflow Markdown was changed. Contributor guidance adds the immutable compilation command and explains why development action mode is unsafe for this checkout sequence. Compilation and PR publication do not authorize a live release.

Compile the release workflow using remote gh-aw actions pinned to the runtime revision used by the failed run. Avoid replacing the repository checkout with runtime action files, and add a regression check plus reproducible compilation guidance.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 94f256ae-a43b-4d03-a2c8-c4a131c22e45
Copilot AI auto review requested due to automatic review settings November 1, 2026 23:17
@lpcox
lpcox merged commit c6ff29f into main Nov 1, 2026
35 of 37 checks passed
@lpcox
lpcox deleted the lpcox-workflow-failure-diagnosis-b06 branch November 1, 2026 23:23

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.

🟡 Changes recommended

PR CI omits the regression test, and nightly upgrades can reintroduce broken local setup references unless the pinned release command is reapplied.

2 open issues
What changed in this PR

This PR fixes release activation cleanup by keeping gh-aw setup action definitions outside the repository checkout. It preserves the previously used runtime revision and the existing release sequence.

Changes:

  • Replace five local setup references with SHA-pinned remote actions and remove colliding runtime checkouts.
  • Record the action pin and remove the pre-activation job’s unused checkout permission.
  • Add a regression test and document the pinned regeneration command.
File Description
release_workflow_test.go Checks that the release lock uses pinned remote gh-aw actions without runtime checkouts.
CONTRIBUTING.md Documents release compilation flags and the local-action cleanup hazard.
.github/​workflows/​release.lock.yml Uses remote setup actions and removes unnecessary checkouts and permission.
.github/​aw/​actions-lock.json Records the immutable gh-aw setup action pin.

Review effort: Max (auto)

Comment thread CONTRIBUTING.md
Comment on lines +123 to +124
When editing `.github/workflows/release.md`, regenerate its lock using remote,
SHA-pinned gh-aw actions:
Comment thread release_workflow_test.go
"github.com/stretchr/testify/require"
)

func TestReleaseWorkflowUsesPinnedRemoteActions(t *testing.T) {
lpcox added a commit that referenced this pull request Nov 2, 2026
## Summary

Follow-up to #15860: fixes the remaining 33 agentic workflow locks and
generated maintenance while preserving triggers, permissions, credential
flows, MCP declarations, engine/container pins, and sandbox controls.

- Replace 158 local setup references with
`github/gh-aw/actions/setup@5fec33b64e8f9159001970542a8357293ca5b09a`;
remove only obsolete runtime checkouts and `actions/setup` sparse
entries. Remote definitions survive later root checkout and post-job
cleanup.
- Correct eight generated gh-aw builds that incorrectly built the
gateway repository. Fetch and verify the same immutable gh-aw source
under `$RUNNER_TEMP/gh-aw-runtime`, outside later root checkouts and
uploaded artifact paths.
- Add a structured, lossless, fail-closed Go normalizer and `make
compile-workflows`. Preserve dev-only maintenance jobs and MCP
declarations; regenerate already-fixed Release with its original
release-mode pin. Release and the actions-cache lock are unchanged.
- Wire maintenance compilation and the nightly upgrader through
normalized generation; add exact-pin, control-preservation, idempotence,
and unknown-shape regressions for all locks and maintenance.

Raw release-mode fleet compilation drops maintenance jobs and emits the
gh-aw source SHA as a nonexistent gh-aw-actions setup-cli ref/CLI
release version. The documented normalization workaround avoids those
compiler defects rather than hand-editing generated locks.

## Validation and limits

- `make agent-finished` passed: build, lint, Go/unit/integration tests
and 694 Rust guard tests. Optional integration prerequisites retain
their existing skips.
- Repeated `make compile-workflows` reproduced the exact reviewed file
hashes. Preservation checks also passed on raw compiler output before
normalization.
- One retained read-only security reviewer: **PASS** for local
validation and feature-branch publication; no confirmed new
vulnerabilities. Reviewed executable deltas, immutable source fetches,
credentials, authorization, artifact paths and sandbox/firewall
protections.
- Native actionlint retains **159 identical baseline finding
identities/counts**, including unsupported newer Actions syntax and
existing ShellCheck diagnostics. Offline zizmor removes **158
self-repository findings**, retaining the same four baseline findings:
dangerous-triggers (2), cache-poisoning and adhoc-packages. These are
not clean scans.
- Diagnostic dry-run compilation rejected existing
`sandbox.mcp.container` during baseline resource extraction and emitted
**no diagnostic lock**. Production declarations were not stripped.
Poutine was unavailable; Docker scanners were not run.
- **No workflows were dispatched or rerun.** Hosted post-hook,
source-build, MCP and sandbox behavior remains unverified. Any
normalization/write error blocks publication of its resulting output.

## Authored Markdown review

| Markdown source | Change | Security impact |
| --- | --- | --- |
| [Nightly upgrader
prompt](https://github.com/github/gh-aw-mcpg/blob/6b98719a88caf81aa57ee1e2a1ae723d3e0a6c32/.github/agentics/nightly-workflow-compiler.md#L32-L70)
| Upgrade with `--no-compile`, then use guarded generation; reject
partial normalization. | Prevents raw local-action regeneration;
permissions, credential recipients and approval behavior unchanged. |
| [CONTRIBUTING
guidance](https://github.com/github/gh-aw-mcpg/blob/6b98719a88caf81aa57ee1e2a1ae723d3e0a6c32/CONTRIBUTING.md#L121-L168)
| Document pin, bounded normalization, private-temp builds, Release
exception and regression commands. | Reproducible runtime provenance and
fail-closed generation; no live execution authorization. |
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.

2 participants