Skip to content

Commit c01a83d

Browse files
Copilotpelikhan
andcommitted
Add non-empty output file check to artifact upload step
- Modified upload step condition from `if: always()` to `if: always() && steps.collect_output.outputs.output != ''` - Only uploads artifact when the collection step found non-empty content - Updated test to verify the new condition is present - Recompiled all existing workflow lock files with the new condition Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent d8ac236 commit c01a83d

6 files changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/issue-triage.lock.yml

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

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

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

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

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

.github/workflows/weekly-research.lock.yml

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

pkg/workflow/agentic_output_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ This workflow tests the agentic output collection functionality.
140140
t.Error("Expected if-no-files-found: warn configuration for artifact upload")
141141
}
142142

143+
// Verify the upload step condition checks for non-empty output
144+
if !strings.Contains(lockContent, "if: always() && steps.collect_output.outputs.output != ''") {
145+
t.Error("Expected upload step to check for non-empty output from collection step")
146+
}
147+
143148
// Verify step order: setup should come before agentic execution, collection should come after
144149
setupIndex := strings.Index(lockContent, "- name: Setup Agent Output File (GITHUB_AW_OUTPUT)")
145150
executeIndex := strings.Index(lockContent, "- name: Execute Claude Code")

pkg/workflow/compiler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2323,7 +2323,7 @@ func (c *Compiler) generateOutputCollectionStep(yaml *strings.Builder, data *Wor
23232323
yaml.WriteString(" cat ${{ env.GITHUB_AW_OUTPUT }} >> $GITHUB_STEP_SUMMARY\n")
23242324
yaml.WriteString(" echo '``````' >> $GITHUB_STEP_SUMMARY\n")
23252325
yaml.WriteString(" - name: Upload agentic output file\n")
2326-
yaml.WriteString(" if: always()\n")
2326+
yaml.WriteString(" if: always() && steps.collect_output.outputs.output != ''\n")
23272327
yaml.WriteString(" uses: actions/upload-artifact@v4\n")
23282328
yaml.WriteString(" with:\n")
23292329
yaml.WriteString(" name: aw_output.txt\n")

0 commit comments

Comments
 (0)