feat(ops): @ops uses its dedicated TOKEN_OPS, not AGENT_TOKEN
The gitea-admin skill now authenticates with TOKEN_OPS (the ops user's admin token), and TOKEN_OPS is injected into the agent process ONLY when name==ops. No other agent holds an admin credential in its env. This unhooks @ops from AGENT_TOKEN, so AGENT_TOKEN can be narrowed to a non-admin token. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
6c753dc0a0
commit
79ea9f68c9
@@ -135,12 +135,13 @@ jobs:
|
||||
- name: Set up `gitea-admin` skill (@ops only — administer the Gitea instance)
|
||||
# Instance administration (orgs/users/repos/labels/secrets/scoped tokens). The SKILL.md is
|
||||
# written ONLY for @ops (skill-gitea-admin.sh gates on NAME), so the admin how-to never
|
||||
# reaches other agents; permission.skill also denies it to everyone but @ops. Uses
|
||||
# AGENT_TOKEN (an admin PAT during bootstrap) — see the script header for the token plan.
|
||||
# reaches other agents; permission.skill also denies it to everyone but @ops. Uses the
|
||||
# dedicated admin token TOKEN_OPS (the `ops` user), NOT AGENT_TOKEN — this step only writes
|
||||
# the doc; the token itself is injected into the Run-agent step only when NAME==ops.
|
||||
env:
|
||||
SCRIPTS: ${{ runner.temp }}/agents-scripts
|
||||
NAME: ${{ steps.prep.outputs.name }}
|
||||
AGENT_TOKEN: ${{ secrets.AGENT_TOKEN }}
|
||||
TOKEN_OPS: ${{ secrets.TOKEN_OPS }}
|
||||
run: bash "$SCRIPTS/skill-gitea-admin.sh"
|
||||
|
||||
- name: Inspect / fetch image attachments (download only for vision agents)
|
||||
@@ -168,6 +169,9 @@ jobs:
|
||||
# It is already a required secret for the delegation step below; exposing it here too
|
||||
# lets the agent process itself call the Gitea API on demand.
|
||||
AGENT_TOKEN: ${{ secrets.AGENT_TOKEN }}
|
||||
# The dedicated admin token for the `gitea-admin` skill — injected into the agent's process
|
||||
# ONLY when it is @ops, so no other agent ever holds an admin credential in its env.
|
||||
TOKEN_OPS: ${{ steps.prep.outputs.name == 'ops' && secrets.TOKEN_OPS || '' }}
|
||||
NAME: ${{ steps.prep.outputs.name }}
|
||||
MODEL: ${{ steps.prep.outputs.model }}
|
||||
VISION: ${{ steps.prep.outputs.vision }}
|
||||
|
||||
Reference in New Issue
Block a user