Skip to content
Draft
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
6 changes: 4 additions & 2 deletions patterns/workflow-generation.json
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,8 @@
"- **DO NOT** approve or request changes.",
"- **DO NOT** manufacture issues or comment on uncertain findings.",
"- Reference affected lines and explain impact."
]
],
"min_integrity": "approved"
},
"daily-test-improver": {
"icon": "check",
Expand Down Expand Up @@ -829,7 +830,8 @@
"- **DO NOT** review generated files, lock files, or unchanged code.",
"- **DO NOT** duplicate comments or manufacture findings.",
"- **DO NOT** apply a skill outside its stated scope."
]
],
"min_integrity": "approved"
},
"security-scanner": {
"icon": "shield",
Expand Down
2 changes: 2 additions & 0 deletions src/js/workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ export function generateWorkflowFile(answers, patterns) {
if (inferred.bash) frontmatter += ' bash: true\n';
if (inferred.githubToolsets) {
frontmatter += ` github:\n toolsets: [${ toolsetsFor(patterns, answers.archetype).join(', ') }]\n`;
const minIntegrity = workflowDefinition(patterns, answers.archetype).min_integrity;
if (minIntegrity) frontmatter += ` min-integrity: ${ minIntegrity }\n`;
}
extras.forEach((extra) => {
if (extra.tool === 'cache-memory') frontmatter += ' cache-memory:\n';
Expand Down
14 changes: 13 additions & 1 deletion test/workflow.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,19 @@ describe('generateWorkflowFile', () => {
patterns
);
expect(md).toContain('permissions:\n contents: read\n issues: read\n pull-requests: read\n');
expect(md).toContain(' github:\n toolsets: [repos, issues, pull_requests]\n');
expect(md).toContain(' github:\n toolsets: [repos, issues, pull_requests]\n min-integrity: approved\n');
});

it('does not add min-integrity for archetypes without untrusted external content', () => {
const md = generateWorkflowFile(
answers({
archetype: 'status-report',
triggers: ['schedule'],
outputs: ['create-issue']
}),
patterns
);
expect(md).not.toContain('min-integrity');
});

it('gives bash-only archetypes a minimal read permissions block', () => {
Expand Down