You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9ab7ed4
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: scripts/restore-repair-job.sh
+26-4Lines changed: 26 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ restore_automerge_job() {
24
24
jobs/*/inbox/automerge-*.md) ;;
25
25
*) return 1 ;;
26
26
esac
27
-
local filename stem rest number repo_slug owner repo_name repo ref branch
27
+
local filename stem rest number repo_slug owner repo_name repo ref branch repair_mode labels merge_instruction
28
28
filename="${JOB_PATH##*/}"
29
29
stem="${filename%.md}"
30
30
rest="${stem#automerge-}"
@@ -39,12 +39,30 @@ restore_automerge_job() {
39
39
repo="$owner/$repo_name"
40
40
ref="#$number"
41
41
branch="clawsweeper/automerge-$repo_slug-$number"
42
+
repair_mode="autofix"
43
+
merge_instruction="Final merge is disabled for autofix. Keep the PR open after a passing ClawSweeper verdict unless a maintainer explicitly changes mode."
44
+
if [[ "${CLAWSWEEPER_REQUESTED_ALLOW_MERGE:-${CLAWSWEEPER_ALLOW_MERGE:-0}}"== 1 ]];then
45
+
if [[ -z"${GH_TOKEN:-}" ]];then
46
+
echo"A GitHub token is required to verify restored automerge authorization.">&2
47
+
return 1
48
+
fi
49
+
if! labels="$(gh api "repos/$repo/issues/$number" --jq '.labels[]?.name'| tr '[:upper:]''[:lower:]')";then
50
+
echo"Unable to verify live authorization for restored repair job $repo#$number.">&2
merge_instruction="Do not merge, close, or bypass review gates from the worker. The comment router owns final merge only after a passing ClawSweeper verdict for the exact current head."
57
+
fi
58
+
fi
42
59
mkdir -p "$(dirname "$JOB_PATH")"
43
60
cat >"$JOB_PATH"<<EOF
44
61
---
45
62
repo: $repo
46
63
cluster_id: automerge-$repo_slug-$number
47
64
mode: autonomous
65
+
repair_mode: $repair_mode
48
66
allowed_actions:
49
67
- comment
50
68
- label
@@ -76,7 +94,7 @@ source: pr_automerge
76
94
77
95
# ClawSweeper adopted PR repair candidate
78
96
79
-
Maintainer opted $ref into ClawSweeper automerge.
97
+
Maintainer opted $ref into ClawSweeper $repair_mode.
@@ -85,7 +103,7 @@ ClawSweeper should use this job only for the bounded ClawSweeper review/fix loop
85
103
86
104
- If ClawSweeper emits an explicit repair marker, requests changes, or finds failing checks/rebase work, and the PR branch is safe to update, emit a fix artifact with \`repair_strategy: "repair_contributor_branch"\` and \`source_prs: ["https://github.com/$repo/pull/$number"]\`.
87
105
- If the PR branch cannot be safely updated, emit a narrow credited replacement only when the artifact can preserve the original contributor credit; otherwise return \`needs_human\`.
88
-
- Do not merge, close, or bypass review gates from the worker. The comment router owns final merge only after a passing ClawSweeper verdict for the exact current head.
106
+
- $merge_instruction
89
107
- Keep repair scope limited to actionable ClawSweeper findings, failing relevant checks, and required review feedback on this PR.
echo"Refusing to restore an unverified automerge repair job: $JOB_PATH">&2
262
+
exit 1
263
+
fi
242
264
write_output job_exists 1
243
265
echo"::notice title=Restored automerge repair job::Job file '$JOB_PATH' was missing from the state checkout; reconstructed it from the workflow input."
0 commit comments