Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: harden fail-fast workflow token handling (#5519)

[._.]/ Adam Eivyfe4d4d7892aa
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5ff90ac507..a20b2fd40d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -118,6 +118,7 @@ jobs:
steps:
- uses: actions/checkout@v7
with:
+ persist-credentials: false
# See the impact job: depth 2 is the whole PR merge ref, which is all
# the planner needs to identify changed sources.
fetch-depth: 2
@@ -271,6 +272,7 @@ jobs:
steps:
- uses: actions/checkout@v7
with:
+ persist-credentials: false
# See the impact job: depth 2 is the whole PR merge ref, which is all
# the planner needs to identify changed sources.
fetch-depth: 2
@@ -353,6 +355,8 @@ jobs:
PGPASSWORD: portos
steps:
- uses: actions/checkout@v7
+ with:
+ persist-credentials: false
- name: Use Node.js 24.x
uses: actions/setup-node@v7
@@ -476,6 +480,7 @@ jobs:
steps:
- uses: actions/checkout@v7
with:
+ persist-credentials: false
# See the impact job: depth 2 is the whole PR merge ref, which is all
# the planner needs to identify changed sources.
fetch-depth: 2
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index a9fa69a49b..9c34521f9b 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -50,6 +50,9 @@ jobs:
full-ci:
needs: verify-ci
if: needs.verify-ci.outputs.verified != 'true'
+ permissions:
+ contents: read
+ actions: write
uses: ./.github/workflows/ci.yml
with:
full: true
diff --git a/scripts/ci-fail-fast.test.js b/scripts/ci-fail-fast.test.js
index ed580e8ec4..56058a692a 100644
--- a/scripts/ci-fail-fast.test.js
+++ b/scripts/ci-fail-fast.test.js
@@ -65,4 +65,20 @@ describe('ci.yml fail-fast cancellation contract', () => {
expect(body, id).toContain('if: failure()');
}
});
+
+ it('does not persist the elevated checkout token into leaf job steps', () => {
+ for (const id of LEAF_JOBS) {
+ const body = jobs[id];
+ const checkoutStart = body.indexOf(' - uses: actions/checkout@v7');
+ const nextStep = body.indexOf('\n - ', checkoutStart + 1);
+ const checkout = body.slice(checkoutStart, nextStep === -1 ? undefined : nextStep);
+ expect(checkout, id).toContain('persist-credentials: false');
+ }
+ });
+
+ it('grants the reusable release caller the permission leaf jobs require', () => {
+ const releaseWorkflow = readFileSync(join(REPO_ROOT, '.github/workflows/release.yml'), 'utf8');
+ const fullCi = releaseWorkflow.slice(releaseWorkflow.indexOf('\n full-ci:'));
+ expect(fullCi).toMatch(/\n permissions:\n contents: read\n actions: write\n/);
+ });
});