Skip to content

Commit 3b57c54

Browse files
authored
Tweaks to safe outputs feature (#240)
* safe outputs revamp * fix lint * fix lint * fix lint * fix lint * fix docs * fix docs * fix docs * renaming * make allowed optional * fix build * fix build * fix docs * make add-issue-comment allow to be null * fix test * fix test * fix test * fix test
1 parent 11b0aa3 commit 3b57c54

28 files changed

Lines changed: 2928 additions & 993 deletions

.github/workflows/test-claude-add-issue-labels.lock.yml

Lines changed: 717 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
on:
3+
issues:
4+
types: [opened]
5+
reaction: eyes
6+
7+
engine:
8+
id: claude
9+
10+
permissions:
11+
issues: read
12+
13+
safe-outputs:
14+
add-issue-labels:
15+
---
16+
17+
Add the issue labels "quack" and "dog" to the issue.
18+

.github/workflows/test-claude-create-issue.lock.yml

Lines changed: 582 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
on:
3+
workflow_dispatch:
4+
5+
engine:
6+
id: claude
7+
8+
permissions:
9+
issues: read
10+
11+
safe-outputs:
12+
create-issue:
13+
title-prefix: "[claude-test] "
14+
labels: [claude, automation, haiku]
15+
---
16+
17+
Create an issue with title "Hello" and body "World"
18+
19+
Add a haiku about GitHub Actions and AI to the issue body.

.github/workflows/test-claude-create-pull-request.lock.yml

Lines changed: 641 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
on:
3+
workflow_dispatch:
4+
5+
engine:
6+
id: claude
7+
8+
safe-outputs:
9+
create-pull-request:
10+
title-prefix: "[claude-test] "
11+
labels: [claude, automation, bot]
12+
---
13+
14+
Add a file "TEST.md" with content "Hello, World!"
15+
16+
Create a pull request with title "Hello" and body "World"
17+
18+
Add a haiku about GitHub Actions and AI to the PR body.

.github/workflows/test-claude.lock.yml

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

.github/workflows/test-claude.md

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,13 @@ on:
1111
engine:
1212
id: claude
1313
model: claude-3-5-sonnet-20241022
14-
permissions:
15-
network:
16-
allowed: []
1714
timeout_minutes: 10
1815
permissions:
1916
pull-requests: write
2017
actions: read
2118
contents: read
22-
output:
23-
labels:
24-
allowed: ["bug", "feature"]
25-
issue:
26-
title-prefix: "[claude-test] "
27-
labels: [claude, automation, haiku]
28-
issue_comment: {}
29-
pull-request:
19+
safe-outputs:
20+
create-pull-request:
3021
title-prefix: "[claude-test] "
3122
labels: [claude, automation, bot]
3223
tools:
@@ -126,14 +117,6 @@ Your comment should include:
126117

127118
**Current Context**: You have access to the current pull request content via: "${{ needs.task.outputs.text }}"
128119

129-
### Action Output: Create a Haiku
130-
131-
**IMPORTANT**: After completing your PR analysis and posting your comment, please create a haiku about the changes you analyzed and write it to the action output. The haiku should capture the essence of the pull request in a creative and poetic way.
132-
133-
Write your haiku to the file "${{ env.GITHUB_AW_OUTPUT }}" (use the `Write` tool). This will make it available as a workflow output that other jobs can access.
134-
135-
Make your haiku relevant to the specific changes you analyzed in this PR. Be creative and thoughtful in your poetic interpretation of the code changes.
136-
137120
### Additional Task: Random Quote Generation
138121

139122
**IMPORTANT**: After creating your haiku, please generate a random inspirational quote about software development, coding, or technology and append it to a new file called "quote.md".

.github/workflows/test-proxy.lock.yml

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

.github/workflows/test-proxy.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on:
44
branches: [ "main" ]
55
workflow_dispatch:
66

7-
output:
8-
issue_comment: {}
7+
safe-outputs:
8+
add-issue-comment:
99

1010
tools:
1111
fetch:
@@ -21,7 +21,8 @@ tools:
2121

2222
github:
2323
allowed:
24-
- "get_issue"
24+
- "create_issue"
25+
- "create_comment"
2526

2627
engine: claude
2728
runs-on: ubuntu-latest
@@ -46,10 +47,10 @@ Test the MCP network permissions feature to validate that domain restrictions ar
4647

4748
If there are any failures, security issues, or unexpected behaviors:
4849

49-
- Write a detailed report to ${{ env.GITHUB_AW_OUTPUT }} documenting:
50-
- Which domains were successfully accessed vs blocked
51-
- Error messages received for blocked domains
52-
- Any security observations or recommendations
53-
- Specific failure details that need attention
50+
- Write a detailed report documenting:
51+
- Which domains were successfully accessed vs blocked
52+
- Error messages received for blocked domains
53+
- Any security observations or recommendations
54+
- Specific failure details that need attention
5455

55-
The test results will be automatically posted as a comment on PR #${{ github.event.pull_request.number }}.
56+
Post the test results as an issue comment on PR #${{ github.event.pull_request.number }}.

0 commit comments

Comments
 (0)