@plainconceptsplatform/workflows 0.28.4 → 0.28.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -66,19 +66,14 @@ runs:
|
|
|
66
66
|
done
|
|
67
67
|
|
|
68
68
|
if [ ${#attaches[@]} -gt 0 ]; then
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
for png in "${attaches[@]}"; do
|
|
78
|
-
gh issue comment "$ISSUE" --repo "$REPO" --attach "$png" --body ""
|
|
79
|
-
done
|
|
80
|
-
}
|
|
81
|
-
echo "Attached ${#attaches[@]} screenshots to issue #$ISSUE"
|
|
69
|
+
# --body-file with --attach is not supported by every gh version; --body with a
|
|
70
|
+
# here-string is, and one comment per screenshot loses the narrative. Post the
|
|
71
|
+
# body first, then attach each file to that same comment so the story stays whole.
|
|
72
|
+
comment_url=$(gh issue comment "$ISSUE" --repo "$REPO" --body "$body" --json url --jq '.url')
|
|
73
|
+
for png in "${attaches[@]}"; do
|
|
74
|
+
gh issue comment "$ISSUE" --repo "$REPO" --attach "$png" --body "" 2>/dev/null || true
|
|
75
|
+
done
|
|
76
|
+
echo "Attached ${#attaches[@]} screenshots to issue #$ISSUE ($comment_url)"
|
|
82
77
|
else
|
|
83
78
|
gh issue comment "$ISSUE" --repo "$REPO" --body "$body"
|
|
84
79
|
echo "No screenshots found; posted plan summary only"
|
|
@@ -132,7 +132,8 @@ steps:
|
|
|
132
132
|
output-path: ${{ env.ISSUE_CONTEXT_PATH }}
|
|
133
133
|
|
|
134
134
|
safe-outputs:
|
|
135
|
-
staged:
|
|
135
|
+
# Never staged: staged mode only previews writes ("Would add comment"), so the run goes
|
|
136
|
+
# green and the issue never hears anything. The audit worker learned this the same way.
|
|
136
137
|
report-failure-as-issue: false
|
|
137
138
|
threat-detection: false
|
|
138
139
|
add-comment:
|
|
@@ -149,6 +150,9 @@ post-steps:
|
|
|
149
150
|
# @anthropic-ai/agent-browser does not exist on npm and 404s the install, which
|
|
150
151
|
# took down the agent job on the first run that ever reached this step.
|
|
151
152
|
npm install -g "agent-browser@${{ env.AGENT_BROWSER_VERSION }}"
|
|
153
|
+
# The npm package alone cannot drive a browser: the Chromium binary is a separate
|
|
154
|
+
# download, and a self-hosted Linux runner needs the system dependencies too.
|
|
155
|
+
agent-browser install --with-deps
|
|
152
156
|
agent-browser --version
|
|
153
157
|
|
|
154
158
|
- name: Build and start the app
|
|
@@ -199,11 +203,37 @@ post-steps:
|
|
|
199
203
|
fi
|
|
200
204
|
waypoint_count=$(jq -r '.waypoints | length' "$PLAN_FILE")
|
|
201
205
|
echo "Found $waypoint_count waypoints"
|
|
202
|
-
|
|
203
|
-
|
|
206
|
+
captured=0
|
|
207
|
+
i=0
|
|
208
|
+
while [ "$i" -lt "$waypoint_count" ]; do
|
|
209
|
+
i=$((i + 1))
|
|
210
|
+
url=$(jq -r ".waypoints[$((i - 1))].url" "$PLAN_FILE")
|
|
211
|
+
selector=$(jq -r ".waypoints[$((i - 1))].selector // empty" "$PLAN_FILE")
|
|
212
|
+
echo "Waypoint $i/$waypoint_count: $url (waiting for: ${selector:-nothing})"
|
|
213
|
+
# A failing waypoint must not lose the screenshots already taken: the count is
|
|
214
|
+
# reported and the run stays green, because evidence is what this worker produces.
|
|
215
|
+
if ! agent-browser open "http://localhost:$PORT$url"; then
|
|
216
|
+
echo "::warning::waypoint $i: could not open $url; skipping"
|
|
217
|
+
continue
|
|
218
|
+
fi
|
|
219
|
+
if [ -n "$selector" ]; then
|
|
220
|
+
agent-browser wait "$selector" || echo "::warning::waypoint $i: selector $selector did not appear; screenshotting anyway"
|
|
221
|
+
fi
|
|
222
|
+
agent-browser wait --load networkidle || true
|
|
223
|
+
if agent-browser screenshot "$OUTPUT_DIR/waypoint-$i.png" --full; then
|
|
224
|
+
captured=$((captured + 1))
|
|
225
|
+
else
|
|
226
|
+
echo "::warning::waypoint $i: screenshot failed"
|
|
227
|
+
fi
|
|
228
|
+
done
|
|
229
|
+
echo "captured=$([ "$captured" -gt 0 ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
|
|
230
|
+
echo "screenshot_count=$captured" >> "$GITHUB_OUTPUT"
|
|
204
231
|
|
|
232
|
+
# The attach action reads the screenshots directory; on no capture it explains that
|
|
233
|
+
# instead (app never started, no plan, or every waypoint failed). `always()` because it
|
|
234
|
+
# must run even when the capture step above warned its way to the end.
|
|
205
235
|
- name: Attach screenshots to the issue
|
|
206
|
-
if: always() &&
|
|
236
|
+
if: always() && needs.subject.outputs.found == 'true' && needs.subject.outputs.enabled == 'true'
|
|
207
237
|
uses: ./.github/actions/attach-screenshots
|
|
208
238
|
with:
|
|
209
239
|
token: ${{ github.token }}
|