fix(ci): permissions model — no top-level perms in ci.yml; callers need write

GitHub Actions permission model for reusable workflows: callers must declare
at least the permission level that any job in the called workflow requests.
Since the phpcs job declares 'permissions: contents: write' (for phpcbf
commit-back), all callers must include 'permissions: contents: write' at
their workflow level.

Changes:
- ci.yml: remove top-level permissions block (was: contents: read); phpcs job
  already has job-level contents: write. Docblock now explains the caller
  requirement clearly.
- ci-self-test.yml: add 'permissions: contents: write' at workflow level.
- README.md: adoption snippet now includes the required permissions block.
- Remove diagnostic bisect/minimal test workflows (used to identify the root
  cause of startup_failure; finding: job-level write in reusable workflow
  requires caller to declare write at workflow level).

Confirmed: ci-bisect-caller with permissions: contents: write = SUCCESS.
Confirmed: actionlint 1.7.4 + yamllint 1.38.0 both clean.

Agent-Session: claude/reusable-ci-20260616
This commit is contained in:
peptiderepo
2026-06-16 11:44:24 +00:00
parent fa1df001ea
commit d0f8c1d65c
7 changed files with 18 additions and 81 deletions

View File

@@ -28,6 +28,12 @@ on:
pull_request:
branches: [main]
# Required: the called ci.yml phpcs job declares contents: write for phpcbf
# commit-back. GitHub enforces that callers must grant at least the permission
# level the reusable workflow's jobs request.
permissions:
contents: write
jobs:
ci:
uses: peptiderepo/peptide-e2e/.github/workflows/ci.yml@main