Skip to content

Commit f24be7a

Browse files
Add upload-artifact safe-output test workflow and compiler test (#25547)
1 parent 5d6fb39 commit f24be7a

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
on:
3+
workflow_dispatch:
4+
permissions:
5+
contents: read
6+
actions: read
7+
engine: copilot
8+
safe-outputs:
9+
upload-artifact:
10+
max-uploads: 1
11+
allowed-paths:
12+
- "output/**"
13+
---
14+
15+
# Test Copilot Upload Artifact
16+
17+
Test the `upload_artifact` safe output type with the Copilot engine.
18+
19+
## Task
20+
21+
Create a small text file at `output/result.txt` with the content "Hello from upload-artifact test" and upload it as a GitHub Actions artifact named "test-artifact".
22+
23+
Output results in JSONL format using the `upload_artifact` tool.

pkg/workflow/compiler_safe_outputs_config_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,21 @@ func TestAddHandlerManagerConfigEnvVar(t *testing.T) {
589589
checkJSON: true,
590590
expectedKeys: []string{"upload_asset"},
591591
},
592+
{
593+
name: "upload_artifact config",
594+
safeOutputs: &SafeOutputsConfig{
595+
UploadArtifact: &UploadArtifactConfig{
596+
MaxUploads: 1,
597+
MaxSizeBytes: 104857600,
598+
AllowedPaths: []string{"output/**"},
599+
},
600+
},
601+
checkContains: []string{
602+
"GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG",
603+
},
604+
checkJSON: true,
605+
expectedKeys: []string{"upload_artifact"},
606+
},
592607
{
593608
name: "update_release config",
594609
safeOutputs: &SafeOutputsConfig{

0 commit comments

Comments
 (0)