Skip to content

Declare the Default Workflow Token Permission in the Repository Settings Payload #1783

Open

Description

@ptr727

repo-config/settings.json does not declare the repository's default workflow token permission (default_workflow_permissions in the Actions permissions API). So repo-config/configure.sh check neither reads nor asserts it, and a repository keeps whatever value it was created with.

The value differs across the fleet. Read from the API on 2026-09-24:

Repository default_workflow_permissions
ptr727/ProjectTemplate read
ptr727/Blog read
ptr727/PlexCleaner write
ptr727/HomeAutomation-Config write

The difference matters wherever a caller omits a workflow-level permissions: block. The hub's reference stubs (catalog/snippets/workflows/test-pull-request.yml, catalog/snippets/workflows/publish-release.yml) declare permissions: {}, but no D-guarantee or spec check requires it. A stub that drops that block inherits write in some repositories and read in others, and no check notices either way. ptr727/HomeAutomation-Config#437 is one such case.

Two possible fixes:

  1. Declare the setting in repo-config/settings.json, presumably read with pull request approval off, so configure.sh check reports drift and apply converges it.
  2. Make the workflow-level permissions: {} block a named audit check on the entry-point callers.

Found by the HomeAutomation-Config re-audit (#1781, escalation 1). Run stamp audit run 2026-09-24T20:41:24Z | hub 2c5802f.

Activity

  1. added
    enhancement
    on Sep 24, 2026
  2. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Decision needed (decision triage, 2026-11-01)

    Question: Should repo-config declare and enforce the Actions default workflow token permission (default_workflow_permissions: read, can_approve_pull_request_reviews: false) through configure.sh check/apply, or should an audit check require permissions: {} at workflow level on entry-point callers?

    Options, recommended first:

    1. Declare read via configure.sh, plus a check (recommended): The setting covers every workflow, including hand-written ones no stub check reaches, and the named check catches drift one level down. Needs a new payload and API call in configure.sh (a separate endpoint, like project.json). Applying it flips 10 repos from write to read, an outward write on each, after confirming no job without a permissions: block relies on implicit write. No work in flight.
    2. Declare read via configure.sh only: Smallest change that removes the inconsistency at the source, but a future stub dropping permissions: {} gets no audit finding naming it. No work in flight.
    3. Audit check on permissions: {} only: Uses existing audit machinery with no setting writes, but leaves 10 repos on write for any workflow outside the stubs, and the hub's own publish-release.yml and test-pull-request.yml lack a top-level permissions: block, so it fails on the hub first. No work in flight.

    Evidence: Live actions/permissions/workflow reads on 2026-11-01: write on 10 cataloged repos, read on 12, and can_approve_pull_request_reviews true on 12. repo-config/settings.json has no such key, and nothing under repo-config, spec, scripts, AUDIT.md, or WORKFLOW.md mentions default_workflow_permissions. repo-config/README.md:67: some associations are things "neither payload's PATCH can express". merge-bot-task.yml:7-8: "no job here declares a GITHUB_TOKEN scope", and no hub workflow approves with GITHUB_TOKEN. The catalog snippets declare permissions: {} but the hub's own entry points do not. WORKFLOW.md D7.2 governs only reusable-job permissions.

    Blocks: none

  3. added
    decision
    on Nov 1, 2026
  4. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Maintainer answer (decision triage, 2026-11-01): Option 1: declare default_workflow_permissions=read and can_approve_pull_request_reviews=false in repo-config, applied through a new configure.sh payload and API call, plus an audit check for permissions: {} on entry-point callers. Applying it to each of the 10 write repos is an outward setting write. It needs a read first confirming no job relies on implicit write, and a go-ahead at apply time. This is now work for the next burndown round.

  5. removed
    decision
    on Nov 1, 2026
  6. ptr727 commented on Nov 20, 2026

    @ptr727
    OwnerAuthor

    Decision triage (2026-11-19) found the open question here already answered or overtaken, so it is not asked:

    The maintainer answered on 2026-11-01 (Option 1). The setting is applied through a new configure.sh payload and API call, plus an audit check for permissions: {}. Each apply to a write repository first needs a read confirming no job relies on implicit write, then a go-ahead at apply time. That go-ahead is asked when the payload exists and the read is done, not now. Neither is on main yet. A live read today shows 13 cataloged repositories on write, up from 10 on 2026-11-01, so the pre-apply read should be re-run then.

  7. ptr727 commented on Nov 24, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-24): PR #4426 merged to develop at 7362607; branch and worktree cleaned up, so this claim holds no files. #1783 stays open for the audit permissions half; a fleet apply is owed to the maintainer.

    Backlog burndown claim (away run 2026-11-24, round 4, group B): branch burndown/workflow-token-permission, issue #1783, its configure.sh half only.

    Per the maintainer's answer of 2026-11-01 (option 1): declare default_workflow_permissions: read and can_approve_pull_request_reviews: false, checked and applied by repo-config/configure.sh through a new payload and the Actions permissions/workflow endpoint, a separate endpoint like project.json.

    Predicted files:

    • repo-config/configure.sh, the new payload's check and apply paths.
    • A new payload file under repo-config/ (name chosen by the worker). Not repo-config/settings.json, which spec/audit.py loads.
    • A new tests/test_configure_*.py covering check drift and apply against a fake gh.
    • repo-config/README.md and docs/repo-config.md, where they list the payloads and what check and apply cover.
    • spec/validate.py, only if its hub file list must name the new payload.

    Not in this claim: the audit check for permissions: {} on entry-point callers, which needs spec/audit.py (claimed by the round 4 group for #3908) and stays open here. No live apply runs: each apply to a repository on write needs the pre-apply read and the maintainer's go-ahead at apply time.

    Any other group needing one of these files waits for this branch to merge.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions