Skip to content

Commit 9829424

Browse files
committed
fix: match apply continuation runs by workflow path
1 parent 630400f commit 9829424

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎.github/workflows/sweep.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2691,7 +2691,7 @@ jobs:
26912691
{
26922692
for run_status in in_progress pending queued waiting requested; do
26932693
gh api --paginate "repos/${{ github.repository }}/actions/runs?per_page=100&status=${run_status}" \
2694-
--jq '.workflow_runs[] | {databaseId:.id, workflowName:.name, displayTitle:.display_title, status:.status, createdAt:.created_at, updatedAt:.updated_at}' 2>/dev/null || true
2694+
--jq '.workflow_runs[] | {databaseId:.id, workflowPath:.path, displayTitle:.display_title, status:.status, createdAt:.created_at, updatedAt:.updated_at}' 2>/dev/null || true
26952695
done
26962696
} | jq -s '.'
26972697
)"
@@ -2713,7 +2713,7 @@ jobs:
27132713
const queued = new Set(["pending", "queued", "waiting", "requested"]);
27142714
function activeRun(run) {
27152715
if (String(run.databaseId || "") === currentRunId) return false;
2716-
if (run.workflowName !== "ClawSweeper") return false;
2716+
if (run.workflowPath !== ".github/workflows/sweep.yml") return false;
27172717
if (String(run.displayTitle || "") !== expectedTitle) return false;
27182718
const status = String(run.status || "");
27192719
if (!active.has(status)) return false;

‎test/sweep-workflow.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ test("apply workflow bounds checkpoints and requeues with a fresh token", () =>
194194
continueStep,
195195
/gh api --paginate "repos\/\$\{\{ github\.repository \}\}\/actions\/runs\?per_page=100&status=\$\{run_status\}"/,
196196
);
197+
assert.match(continueStep, /workflowPath:\.path/);
198+
assert.match(continueStep, /run\.workflowPath !== "\.github\/workflows\/sweep\.yml"/);
199+
assert.doesNotMatch(continueStep, /workflowName:\.name/);
200+
assert.doesNotMatch(continueStep, /run\.workflowName !== "ClawSweeper"/);
197201
assert.doesNotMatch(continueStep, /gh run list/);
198202
assert.match(continueStep, /const seen = new Set\(\)/);
199203
assert.match(continueStep, /seen\.has\(id\)/);

0 commit comments

Comments
 (0)