Skip to content

Commit 9edded3

Browse files
committed
only capture on upload
1 parent 58c7690 commit 9edded3

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Check out the [flow CI workflow](https://github.com/jahvon/flow/blob/main/.githu
4141
| `working-directory` | Directory to run flow from | `.` |
4242
| `timeout` | Timeout for executable execution | `30m` |
4343
| `continue-on-error` | Continue workflow if flow executable fails | `false` |
44+
| `upload` | Whether to upload flow logs as an artifact | `false` |
4445

4546
## Outputs
4647

action.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,13 @@ runs:
122122
VAULT_KEY: ${{ inputs.vault-key }}
123123
CONTINUE_ON_ERROR: ${{ inputs.continue-on-error }}
124124
GITHUB_OUTPUT: ${{ github.outputs }}
125+
CAPTURE: ${{ inputs.upload == 'true' }}
125126

126127
- name: Upload flow logs
127128
uses: actions/upload-artifact@v4
128129
if: ${{ inputs.upload == 'true' && steps.flow-exec.outputs.exit-code != '0' }}
129130
with:
130-
name: flow-logs-${{ github.run_id }}
131+
name: flow-executable-logs-${{ github.job }}
131132
path: ${{ inputs.working-directory }}/executable_output.txt
132133
retention-days: 1
133134

scripts/execute.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ set +e
1313

1414
echo "🚀 Executing: flow $EXECUTABLE_INPUT"
1515

16-
if [ "${CONTINUE_ON_ERROR:-false}" = "true" ]; then
16+
if [ "$CAPTURE" = "true" ]; then
1717
flow $EXECUTABLE_INPUT 2>&1 | tee executable_output.txt
18-
exit_code=$?
18+
else
19+
flow $EXECUTABLE_INPUT
20+
fi
21+
exit_code=$?
22+
23+
if [ "${CONTINUE_ON_ERROR:-false}" = "true" ]; then
1924
echo "📊 Executable completed with exit code: $exit_code (continue-on-error enabled)"
2025
else
21-
flow $EXECUTABLE_INPUT 2>&1 | tee executable_output.txt
22-
exit_code=$?
2326
if [ $exit_code -ne 0 ]; then
2427
echo "❌ Executable failed with exit code $exit_code"
2528
echo "::endgroup::"

0 commit comments

Comments
 (0)