Skip to content

Commit a66026d

Browse files
authored
Declare output variables on the fly to guard safe-outputs jobs (#1097)
* emit output guard for create-issue * Remove unused print job and related configurations from workflow files * Update prompt to create a poem and post it as a new issue * Add output_types to workflow configurations and update job conditions for create_issue * Update job conditions for create_issue and create_pull_request in workflow files * Refactor job condition handling for create-issue and create-pull-request workflows to use BuildSafeOutputType function * Update job condition checks to reference outputs directly from the agent in workflow files * Fix formatting of output mapping in buildMainJob function
1 parent 2e9c90e commit a66026d

23 files changed

Lines changed: 823 additions & 234 deletions

.github/workflows/artifacts-summary.lock.yml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/ci-doctor.lock.yml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/dev.lock.yml

Lines changed: 646 additions & 180 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/dev.md

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,14 @@
11
---
22
on:
33
workflow_dispatch:
4-
reaction: "eyes"
54
push:
65
branches:
76
- copilot/*
7+
- collect-guards
88
engine: copilot
99
safe-outputs:
1010
staged: true
11-
jobs:
12-
print:
13-
#name: "print the message"
14-
runs-on: ubuntu-latest
15-
inputs:
16-
message:
17-
description: "Message to print"
18-
required: true
19-
type: string
20-
steps:
21-
- name: See artifacts
22-
run: cd /tmp/safe-jobs && ls -lR
23-
- name: print message
24-
run: |
25-
if [ -f "$GITHUB_AW_AGENT_OUTPUT" ]; then
26-
MESSAGE=$(cat "$GITHUB_AW_AGENT_OUTPUT" | jq -r '.items[] | select(.type == "print") | .message')
27-
echo "print: $MESSAGE"
28-
echo "### Print Step Summary" >> "$GITHUB_STEP_SUMMARY"
29-
echo "$MESSAGE" >> "$GITHUB_STEP_SUMMARY"
30-
else
31-
echo "No agent output found, using default: Hello from safe-job!"
32-
fi
11+
create-issue:
12+
create-pull-request:
3313
---
34-
Summarize and use print the message using the `print` tool.
35-
36-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
14+
Create a poem and post it as a new issue.

.github/workflows/tidy.lock.yml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/cli/workflows/test-all.lock.yml

Lines changed: 16 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/cli/workflows/test-claude-max-patch-size.lock.yml

Lines changed: 17 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/cli/workflows/test-claude-missing-tool.lock.yml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)