Skip to content

fix(workflows): declare write permissions in anomaly triage caller #106

Description

@ArchonVII

Summary

The managed examples/anomaly-triage.yml caller omits an explicit permissions block. Consumers whose repository default is a read-only GITHUB_TOKEN fail at workflow startup because the called reusable job requests pull-requests: write and issues: write.

Evidence

  • Consumer: ArchonVII/sales (default_workflow_permissions: read).
  • Failed runs: https://github.com/ArchonVII/sales/actions/runs/29062244365 and https://github.com/ArchonVII/sales/actions/runs/29062294338.
  • Both runs concluded startup_failure with zero jobs and no logs.
  • sales/.github/workflows/anomaly-triage.yml matches github-workflows/examples/anomaly-triage.yml and declares no top-level permissions.
  • The reusable workflow at .github/workflows/anomaly-triage.yml@v1 requires contents: read, pull-requests: write, and issues: write for its triage job.
  • actionlint examples/anomaly-triage.yml is clean; this is a token-permission contract gap, not YAML syntax.

Reproduction

  1. Install examples/anomaly-triage.yml in a repository whose Actions default workflow permissions are read-only.
  2. Open or update a PR that changes .archon/anomalies-thispr.md.
  3. Observe the Anomaly triage workflow fail before any job starts.

Expected behavior

The managed caller explicitly grants the least privileges required by the reusable workflow, and anomaly entries are routed to PR comments/issues.

Actual behavior

The workflow ends as startup_failure; anomalies are not routed and no diagnostic log is available.

Acceptance Criteria

  • Add an explicit least-privilege caller block: contents: read, pull-requests: write, issues: write.
  • Verify the example with actionlint.
  • Refresh the archon-setup snapshot from the provider rather than editing the snapshot first.
  • Update affected consumers through the normal updater path.
  • Exercise a consumer PR containing a correctly formatted anomaly entry and confirm the workflow creates jobs and routes it idempotently.

Impact

Medium — off-task defects silently remain untracked in every read-default consumer using this managed caller. Required gates are unaffected, so feature PRs can merge while anomaly routing is broken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions