Repository navigation
Done
Labels
Description
Version Information
- Broken: v1.2.2 and v1.2.3 (compiler and
github/gh-aw-actions/setup) - Last known working: v1.0.1
- Likely introduced by Use compiler JSON metadata in the setup runtime #75997 ("Use compiler JSON metadata in the setup runtime")
Configuration / Code
An agentic workflow compiled in a private repo (myorg/shared-workflows) and consumed by other repos in the same org as a reusable workflow:
# myorg/shared-workflows/.github/workflows/generate.md (compiled to generate.lock.yml)
---
on:
workflow_call:
inputs:
tag-name:
required: true
type: string
permissions:
contents: read
engine: copilot
safe-outputs:
update-release:
max: 1
---
# Update a release
Rewrite the body of the release tagged `${{ inputs.tag-name }}`.# myorg/my-app/.github/workflows/release-notes.yml (caller)
on:
release:
types: [published]
jobs:
notes:
uses: myorg/shared-workflows/.github/workflows/generate.lock.yml@main
with:
tag-name: ${{ github.event.release.tag_name }}
permissions:
actions: read
contents: write
copilot-requests: write
pull-requests: read
secrets: inheritExpected Behavior
The activation job's Generate agentic run info step loads the compiler metadata for the executing lock file and activation continues, as it did on v1.0.1.
Actual Behavior
The step calls the Contents API for the lock file in the callee repo using the caller's default GITHUB_TOKEN. That token is scoped to the caller repo, so the call 404s and activation fails. Every caller of the shared workflow is broken.
GET /repos/myorg/shared-workflows/contents/.github%2Fworkflows%2Fgenerate.lock.yml?ref=<sha> - 404
RequestError [HttpError]: Not Found - https://docs.github.com/rest/repos/contents#get-repository-content
at async readRemoteMarkdownMetadata (/home/runner/work/_temp/gh-aw/actions/markdown_metadata.cjs:286:20)
at async loadMarkdownMetadata (/home/runner/work/_temp/gh-aw/actions/markdown_metadata.cjs:306:29)
at async main (/home/runner/work/_temp/gh-aw/actions/generate_aw_info.cjs:64:28)
##[error]Unhandled error: HttpError: Not Found
Steps to Reproduce
- In a private repo, compile the workflow above with gh-aw v1.2.2 and push it.
- In another repo in the same org, add the caller above (allow access to the private repo's workflows in its Actions settings).
- Publish a release in the caller repo.
activationfails at Generate agentic run info with the 404 above.
Additional Context
- In
loadMarkdownMetadata,remoteis true wheneverGH_AW_INFO_WORKFLOW_SHAis set or the caller repo differs from the workflow repo. It then callsreadRemoteMarkdownMetadatawithglobal.github, i.e. the caller'sGITHUB_TOKEN. That token can never read another private repo, regardless of the permissions the caller grants. - v1.2.3 adds
readGitObjectMarkdownMetadata, butactivationdoesn't check out the callee repo before this step. So the local git object isn't there, the code falls back to the same API call, and it still 404s. - There seems to be no frontmatter option to supply a different token for this read, or to skip it.
- Possible fixes: read the metadata from a token that can access the callee repo (e.g.
GH_AW_GITHUB_TOKENwhen present), check out the callee lock file before this step, or embed the needed metadata in the lock file so no remote read is needed.
Workaround
Pin the compiler to v1.0.1 (gh extension install github/gh-aw --pin v1.0.1) and recompile.
Reacted by Richard Homewood
Reacted by Copilot
Activity