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
8 changes: 8 additions & 0 deletions .changeset/fix-yaml-escaping-skill.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@bradygaster/squad-cli": patch
---

Fix YAML escaping in skill command apm.yml generation

Use `JSON.stringify()` for skill descriptions in generated apm.yml files
to properly escape quotes and newlines, preventing invalid YAML output.
1 change: 1 addition & 0 deletions .github/workflows/squad-impact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
permissions:
contents: read
pull-requests: write
issues: write

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/squad-pr-nudge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:
contents: read
pull-requests: write
checks: read
issues: read
issues: write

jobs:
nudge-stale-prs:
Expand Down Expand Up @@ -146,8 +146,8 @@ jobs:
base: pr.base.ref,
head: pr.head.sha
});
if (comparison.data.ahead_by > 10) {
actions.push(`⬇️ **${comparison.data.ahead_by} commits behind ${pr.base.ref}.** Rebase to pick up latest changes.`);
if (comparison.data.behind_by > 10) {
actions.push(`⬇️ **${comparison.data.behind_by} commits behind ${pr.base.ref}.** Rebase to pick up latest changes.`);
}

// 6. If everything looks good and approved — it's ready to merge
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/squad-pr-readiness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha || github.event.workflow_run.head_sha }}
PR_BASE_REF: ${{ github.event.pull_request.base.ref || github.event.workflow_run.pull_requests[0].base.ref }}
PR_DRAFT: ${{ github.event.pull_request.draft || 'false' }}
PR_LABELS: ${{ toJson(github.event.pull_request.labels || '[]') }}
PR_LABELS: ${{ toJson(github.event.pull_request.labels) }}
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}
RUN_NAME: ${{ github.workflow }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/squad-repo-health.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
permissions:
contents: read
pull-requests: write
issues: write

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
Expand Down
7 changes: 4 additions & 3 deletions packages/squad-cli/src/cli/commands/skill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,16 @@ async function publish(dest: string, skillName?: string): Promise<void> {

// Build the skill's own apm.yml inside its directory
const apmSkillPath = join(skillsDir, skillName, 'apm.yml');
const safeDesc = fm['description'] ? JSON.stringify(fm['description']) : null;
const skillApm = [
`name: ${fm['name'] ?? skillName}`,
`version: ${fm['version'] ?? '1.0.0'}`,
fm['description'] ? `description: "${fm['description']}"` : null,
safeDesc ? `description: ${safeDesc}` : null,
``,
`skills:`,
` - name: ${fm['name'] ?? skillName}`,
` path: skill.md`,
fm['description'] ? ` description: "${fm['description']}"` : null,
safeDesc ? ` description: ${safeDesc}` : null,
]
.filter(l => l !== null)
.join('\n');
Expand Down Expand Up @@ -195,7 +196,7 @@ async function publish(dest: string, skillName?: string): Promise<void> {
...skills.map(s =>
[
` - name: ${s.name}`,
s.description ? ` description: "${s.description}"` : null,
s.description ? ` description: ${JSON.stringify(s.description)}` : null,
` path: ${s.path}`,
s.version ? ` version: ${s.version}` : null,
]
Expand Down
5 changes: 4 additions & 1 deletion scripts/check-bootstrap-deps.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ const NODE_BUILTINS = new Set([
* Accepts both `node:fs` and `fs` forms, as well as subpaths like `node:fs/promises`.
*/
function isNodeBuiltin(specifier) {
if (specifier.startsWith('node:')) return true;
if (specifier.startsWith('node:')) {
const base = specifier.slice(5).split('/')[0];
return NODE_BUILTINS.has(base);
}
const base = specifier.split('/')[0];
return NODE_BUILTINS.has(base);
}
Expand Down
15 changes: 13 additions & 2 deletions scripts/pr-readiness.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,16 @@ export function checkCIStatus(checkRuns, statuses) {
if (otherChecks.length === 0 && (statuses || []).length === 0) {
return { pass: false, detail: 'No CI checks have run yet' };
}
// Check legacy combined statuses for failure/error states
const failedStatuses = (statuses || []).filter(
(s) => s.state === 'failure' || s.state === 'error',
);
if (failedStatuses.length > 0) {
return {
pass: false,
detail: `${failedStatuses.length} status(es) failing: ${failedStatuses.map((s) => s.context).join(', ')}`,
};
}
return { pass: true, detail: 'All checks passing' };
Comment on lines +246 to 256
}

Expand Down Expand Up @@ -312,7 +322,7 @@ export function buildFileList(files) {

if (truncated) {
const remaining = files.length - MAX_FILE_LIST;
rows.push(`| ... | **+${remaining} more files** | |`);
rows.push(`| ... | **+${remaining} more files** |`);
}

return [
Expand Down Expand Up @@ -442,7 +452,8 @@ export async function run({ env = process.env, fetchFn = globalThis.fetch } = {}

let prLabels = [];
try {
prLabels = JSON.parse(prLabelsRaw);
const parsed = JSON.parse(prLabelsRaw);
prLabels = Array.isArray(parsed) ? parsed : [];
Comment on lines +455 to +456
} catch {
prLabels = [];
}
Expand Down
Loading