Enhance error messaging and cleanup in license check and project reso… - #23
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Improves the robustness of GitHub Actions workflow command logging and temporary-file handling in the Dependency-Track project resolver and license inventory scan.
Changes:
- Added
escape_workflow_valueto percent-encode workflow command payloads (e.g.,::warning::) in both the resolver script and the license-check action. - Added an
EXITtrap in the license-check action to centralize cleanup of temporary files. - Escaped
DT_PROJECT_NAMEwhen included in warning annotations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| resolve-dt-project/resolve-project.sh | Escapes warning prefix/message to safely emit ::warning:: workflow commands. |
| dt-license-check/action.yml | Adds workflow-command escaping, introduces temp-file cleanup trap, and escapes project name in warnings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+82
to
+89
| cleanup_temp_files() { | ||
| rm -f "${PAGE_FILE:-}" "${DETAIL_FILE:-}" "${UNIQUE_LICENSES_FILE:-}" \ | ||
| "${DT_LICENSES_FILE:-}" "${DT_LICENSES_HEADERS_FILE:-}" \ | ||
| "${NORMALIZED_FILE:-}" "${COMPONENTS_FILE:-}" | ||
| if [[ -n "${COMPONENTS_FILE:-}" ]]; then | ||
| rm -f "${COMPONENTS_FILE}.next" | ||
| fi | ||
| } |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
dt-license-check/action.yml:91
cleanup_temp_filesruns underset -ewhile anERRtrap is installed. If anyrmfails (e.g., permission/IO issues), it can trigger theERRtrap during cleanup and emit a misleading warning / overwrite outputs. Make the cleanup best-effort by preventingrmfailures from propagating.
if [[ -n "$f" ]]; then rm -f "$f"; fi
done
if [[ -n "${COMPONENTS_FILE:-}" ]]; then
rm -f "${COMPONENTS_FILE}.next" || true
fi
ACodingPhilosopher
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixen fra copilot