-
Notifications
You must be signed in to change notification settings - Fork 5
Fix verbose log artifact name conflicts on multiple action invocations #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -476,6 +476,8 @@ runs: | |
| fi | ||
| echo "verbose-log-file=$VERBOSE_LOG_FILE" >> $GITHUB_OUTPUT | ||
| echo "Verbose log file: $VERBOSE_LOG_FILE" | ||
| VERBOSE_LOG_BASENAME=$(basename "$VERBOSE_LOG_FILE") | ||
| echo "verbose-log-artifact-name=cagent-verbose-log-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}-${GITHUB_JOB}-${VERBOSE_LOG_BASENAME}" >> $GITHUB_OUTPUT | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see how this is different from the current artifact path name
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The difference is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MINOR EDGE CASE The artifact name construction doesn't validate against GitHub Actions artifact naming requirements (max 256 characters, forbidden characters: While Impact: Very low - mktemp uses a restricted character set by design. |
||
|
|
||
| # Build command arguments array (SECURE: no eval!) | ||
| ARGS=("run" "--exec") | ||
|
|
@@ -701,7 +703,7 @@ runs: | |
| if: always() && steps.run-agent.outputs.verbose-log-file != '' | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
| with: | ||
| name: cagent-verbose-log-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }} | ||
| name: ${{ steps.run-agent.outputs.verbose-log-artifact-name }} | ||
| path: ${{ steps.run-agent.outputs.verbose-log-file }} | ||
| retention-days: 14 | ||
| if-no-files-found: ignore | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you absolutely positive this will not conflict if run twice in a row?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes —
mktempguarantees a unique filename on every call (that's its core contract). Each invocation of the action creates its own distinct temp file (e.g.,cagent-verbose-liMsf4,cagent-verbose-wbVWRb), and the artifact name includes that unique basename, so two back-to-back invocations will always produce different artifact names.