cozystack/.github
Myasnikov Daniil 76c4eabdff
fix(ci): use a read-only app token for the Copilot step
Review feedback on PR #2460: the Generate changelog using AI step ran
Copilot with --allow-all-tools and GH_TOKEN set to the write-capable
installation token issued to the job (contents: write,
pull-requests: write on all cozystack/* repos). The scope rules in
docs/agents/changelog.md and the step prompt tell the agent not to
use those permissions, but nothing at the token layer prevented it.

Mint a second, read-only installation token from the same app
(same COZYSTACK_CI_APP_ID / COZYSTACK_CI_PRIVATE_KEY, scoped to
contents/pull-requests/metadata read) and pass that one to the AI
step instead. The write-capable token is still used by the checkout,
commit/push, and PR-creation steps that actually need it.

This is defense in depth: even if a future prompt change or agent
misbehavior ignored the scope rules, the token itself has no write
capability on any repository in the cozystack org. No new secret,
no new GitHub App install, no admin-side change — the RO token is
minted in the same workflow from the same app credentials.

Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-04-23 12:26:14 +05:00
..
ISSUE_TEMPLATE Update .github/ISSUE_TEMPLATE/bug_report.md 2025-10-08 17:30:56 +03:00
workflows fix(ci): use a read-only app token for the Copilot step 2026-04-23 12:26:14 +05:00
CODEOWNERS chore(maintenance): add @myasnikovdaniil to CODEOWNERS 2026-04-21 14:31:07 +05:00
PULL_REQUEST_TEMPLATE.md docs(ci): require screenshots for UI changes in PR template 2026-04-16 00:34:52 +03:00