Skip to content

Commit e8637c2

Browse files
TMHSDigitalclaude
andcommitted
Let the Action resume a scan under a changed time budget
d700ac1 compared the saved command line with the one the Action builds, including -max-duration, so continuing a scan stopped at one budget with another (as the CI resume test does, 2s then 5m) started a new scan. The time budget is now left out on both sides, in both its "-max-duration X" and "-max-duration=X" forms; it never changes what is scanned, and the inputs key already left it out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent d700ac1 commit e8637c2

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

‎action.yml‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,17 @@ runs:
247247
resumed=false
248248
# The state's command line is replayed as it is, so it must be the one
249249
# this run would run anyway: a state that names other flags or paths
250-
# starts a new scan. A resumed run appends -max-duration=VALUE, and a
251-
# simulation pins a leading -seed; neither changes what is scanned.
252-
want=$(printf '%s\0' "${flags[@]}" "${extra[@]}" "${target[@]}" | jq -Rsc 'split("\u0000") | .[:-1]')
250+
# starts a new scan. The time budget is left out on both sides: it may
251+
# change between runs (a resumed run appends -max-duration=VALUE), and
252+
# a simulation pins a leading -seed; neither changes what is scanned.
253+
strip='def strip: if length == 0 then .
254+
elif .[0] == "-max-duration" then .[2:] | strip
255+
elif (.[0] | startswith("-max-duration=")) then .[1:] | strip
256+
else [.[0]] + (.[1:] | strip) end;'
257+
want=$(printf '%s\0' "${flags[@]}" "${extra[@]}" "${target[@]}" | jq -Rsc "$strip"' split("\u0000") | .[:-1] | strip')
253258
same_args() {
254-
jq -e --argjson want "$want" '(.args | if .[0] == "-seed" then .[2:] else . end
255-
| map(select(startswith("-max-duration=") | not))) == $want' "$base/state.json" > /dev/null 2>&1
259+
jq -e --argjson want "$want" "$strip"' (.args | if .[0] == "-seed" then .[2:] else . end | strip) == $want' \
260+
"$base/state.json" > /dev/null 2>&1
256261
}
257262
if [ -z "$PREVIOUS" ] && [ -n "$BASELINE" ] && [ -s "$base/state.json" ]; then
258263
if [ "$(cat "$base/state.key" 2> /dev/null)" = "$key" ] && same_args; then

0 commit comments

Comments
 (0)