Skip to content

CI Coach workflow uses invalid 'copilot-requests' permission: root cause analysis and remediation plan #20717

@grahame-white

Description

@grahame-white

Analysis

Error Recap

The CI validator reports this error when validating the .github/workflows/ci-coach.lock.yml workflow file:

The workflow is not valid. .github/workflows/ci-coach.lock.yml (Line: 259, Col: 7): The permission 'copilot-requests' is not allowed

Root Cause Investigation

  1. GitHub Actions Permission Model

  2. copilot-requests Permission

    • There is no documented permission named copilot-requests in GitHub Actions' permissions model (as of March 2026).
    • The only supported permissions include scopes like contents, pull-requests, issues, etc (see full list in GitHub docs).
  3. How Did 'copilot-requests' Get Introduced?

    • Either the workflow YAML or a workflow compilation step (i.e., the ci-coach.lock.yml file, possibly auto-generated from a markdown workflow) is declaring permissions: copilot-requests: ... under a workflow or job section.
    • It is likely that during workflow authoring or conversion, an invalid permission name was specified—perhaps as a typo, a speculative scope, or due to a misunderstanding of available permissions, or because of copy-pasta from older or non-standard Copilot workflow content.
  4. Actions Validator Behavior

    • The validator enforces the allowed set of permissions strictly. Any unknown permission triggers this error, blocking workflow runs or merges in repos with strict policies.

Why This Happened

  • There is no copilot-requests permission in official GitHub Actions permissions. Its use indicates a documentation gap, mistaken assumption, or improper copying from somewhere else.
  • If converting a markdown workflow to .lock.yml, it suggests the toolchain allows or does not warn about invalid permission scopes, letting the error slip through to workflow validation.
  • If hand-edited, it may be legacy or accidental entry.

Impact

  • The workflow fails validation and cannot run or be merged if workflows are checked strictly.
  • This may block CI, automation, or deployments relying on the CI Coach workflow.

Proposed Remediation Plan

  1. Locate every use of permissions: copilot-requests: ... in both the markdown source(s) and the compiled .lock.yml.
  2. Remove or replace copilot-requests with only valid permission scopes, per GitHub documentation.
    • If Copilot API or workflow context is needed, check if contents or openId-related scopes are required instead. (There is no copilot-requests scope as of this writing.)
  3. If generated by a tool:
    • Update the workflow generation logic to warn about and block non-standard permission scopes that are not part of the documented set.
  4. Recompile and validate:
    • Rerun the workflow generator (e.g., gh aw compile) and commit updated workflows.
    • Validate that no invalid permission scopes remain.
  5. Document:
    • Update any developer docs and CONTRIBUTING.md to remind contributors to only use documented GitHub Actions permissions.

References

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions