Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/release-readiness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.base.sha }}
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
Expand Down
8 changes: 7 additions & 1 deletion tests/release/release-contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,12 @@ describe('release coordinator trust and recovery', () => {
});
expect(readiness.permissions).toEqual({ contents: 'read' });
expect(readiness.jobs).toHaveProperty('release-pr-readiness');
const readinessCheckout = readiness.jobs?.['release-pr-readiness']?.steps?.find((step) =>
step.uses?.startsWith('actions/checkout@'),
);
expect(readinessCheckout).toBeDefined();
expect(readinessCheckout?.with ?? {}).not.toHaveProperty('ref');
expect(readinessCheckout?.with).toMatchObject({ 'persist-credentials': false });

const gate = jobSource('release-readiness.yml', 'release-pr-readiness');
for (const predicate of [
Expand All @@ -412,7 +418,7 @@ describe('release coordinator trust and recovery', () => {
expect(gate).toContain(predicate);
}
const readinessSource = source('release-readiness.yml');
expect(readinessSource).toContain('github.event.pull_request.base.sha');
expect(readinessSource).not.toContain('github.event.pull_request.base.sha');
expect(readinessSource).not.toContain('github.event.pull_request.head.sha');
expect(readinessSource).not.toContain('github.event.pull_request.head.ref');
expect(readinessSource).toContain('node-version: 22');
Expand Down
8 changes: 7 additions & 1 deletion tests/workflows/ci-policy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,14 @@ describe('pull-request trust boundary', () => {
expect(targetWorkflows).toEqual(['release-readiness.yml']);
const trustedGate = workflow('release-readiness.yml');
expect(trustedGate.permissions).toEqual({ contents: 'read' });
const trustedCheckout = allSteps(trustedGate).find((step) =>
step.uses?.startsWith('actions/checkout@'),
);
expect(trustedCheckout).toBeDefined();
expect(trustedCheckout?.with ?? {}).not.toHaveProperty('ref');
expect(trustedCheckout?.with).toMatchObject({ 'persist-credentials': false });
const trustedSource = workflowSource('release-readiness.yml');
expect(trustedSource).toContain('github.event.pull_request.base.sha');
expect(trustedSource).not.toContain('github.event.pull_request.base.sha');
expect(trustedSource).not.toContain('github.event.pull_request.head.sha');
expect(trustedSource).not.toContain('github.event.pull_request.head.ref');
expect(trustedSource).not.toContain('secrets.');
Expand Down
Loading