Skip to content

v0.90.3: strict mode rejects documented github-app.repositories: ["*"] (no explicit repositories input) #65814

Description

@jaroslawgajewski

Summary

Since v0.90.3, any strict: true workflow that sets github-app.repositories: ["*"] fails to compile. This affects both tools.github.github-app and safe-outputs.github-app:

error: strict mode: actions/create-github-app-token in job "agent" has no explicit repositories input; add repositories: ${{ github.repository }} to scope the token to the current repository

["*"] is the documented way to request an installation token without a repository restriction. The glossary entry for github-app.repositories says that for ["*"], implementations omit the repositories parameter from the token-minting call. The compiler does exactly that. The new check from #64976 then rejects the step it generated itself, because the step has no repositories input. The suggested fix (repositories: ${{ github.repository }}) would remove the cross-repository access that ["*"] exists to grant.

Versions

Reproduction

.github/workflows/wildcard-strict.md:

---
on: workflow_dispatch
strict: true
engine: copilot
permissions:
  contents: read
tools:
  github:
    toolsets: [repos]
    github-app:
      app-id: ${{ vars.APP_ID }}
      private-key: ${{ secrets.APP_PRIVATE_KEY }}
      repositories: ["*"]
---
List the repositories in this organization.
gh aw compile .github/workflows/wildcard-strict.md
Variant v0.90.1 v0.90.3
tools.github.github-app, repositories: ["*"], strict: true compiles error in job agent
safe-outputs.github-app, repositories: ["*"], strict: true compiles error in job conclusion
repositories: ["*"], strict: false compiles compiles with the same message as a warning
repositories: ["repo-a", "repo-b"], strict: true compiles compiles

The token step v0.90.1 generates for ["*"]. It is correct per the docs, and it already carries an explicit permission-* scope:

- name: Generate GitHub App token
  id: github-mcp-app-token
  uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
  with:
    client-id: ${{ vars.APP_ID }}
    private-key: ${{ secrets.APP_PRIVATE_KEY }}
    owner: ${{ github.repository_owner }}
    github-api-url: ${{ github.api_url }}
    permission-contents: read

Expected

A workflow that explicitly opts into repositories: ["*"] should compile in strict mode. The wildcard is an explicit, reviewed choice in the source, so it should not count as an unscoped token. The permission-* part of the #64976 check is unaffected: the wildcard step already sets permission-contents: read.

Impact

Organisation-wide workflows (org audits, cross-repo PR scanning, multi-repo reporting) can't run strict mode on v0.90.3 at all. A fleet that imports one shared github-app config with ["*"] fails wholesale. The only options are dropping strict: true across the fleet, or post-processing the lock files.

Possible fixes

  • Treat a token step generated from repositories: ["*"] as explicitly scoped. For example, the compiler could record the wildcard intent so hasExplicitAppTokenRepositories accepts it, or skip the repositories check when the source config is ["*"].
  • Or keep it as a warning, not a strict-mode error, when the source config is ["*"], as the non-strict path already does.

Either way, the error text should not suggest ${{ github.repository }} for a wildcard config, because that silently changes the token's scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions