-
Notifications
You must be signed in to change notification settings - Fork 0
Feat: Adding fetched AquaSec JSON as workflow artifact. #89
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f13301e
Feat: Adding fetched AquaSec JSON as workflow artifact.
tmikula-dev a85cbb8
Merge branch 'master' into feature/88-add-aqua-json-artifact
tmikula-dev 4673f91
Updating the documentation.
tmikula-dev 5e8fcc0
Merge remote-tracking branch 'origin/feature/88-add-aqua-json-artifac…
tmikula-dev 37f4227
Updating the dry-run logging.
tmikula-dev 7778c45
Bug fix logging.
tmikula-dev 5c51b7d
Merge branch 'master' into feature/88-add-aqua-json-artifact
miroslavpojer 2825e59
Fixing the test with only valid asserts.
tmikula-dev c033f2c
Merge remote-tracking branch 'origin/feature/88-add-aqua-json-artifac…
tmikula-dev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: AbsaOSS/organizational-workflows
Length of output: 233
🏁 Script executed:
Repository: AbsaOSS/organizational-workflows
Length of output: 10225
🌐 Web query:
actions/upload-artifact v4 behavior when workflow job fails does it upload artifact if files already exist skipped unless continue-on-error💡 Result:
In GitHub Actions, the actions/upload-artifact@v4 action does not automatically upload files if a job fails; standard steps in a workflow job are skipped when a previous step fails or the job itself enters a failed state [1][2][3]. To ensure an artifact is uploaded even when a job fails, you must explicitly use the if: failure or if: always conditional on the upload step [1][3]. Regarding the behavior of v4: - Artifacts are immutable once created [4][5]. - Uploading to an artifact name that already exists in the same workflow run will cause an error (Conflict: 409) [4][6]. - If you use the overwrite: true option, the action will attempt to delete the existing artifact with that name before creating the new one [7][8]. However, this is not atomic and is intended for serial operations (e.g., modifying a file and re-uploading), not for parallel jobs trying to merge data into a single artifact [9]. - If a job fails, and you have not configured the upload step with an appropriate conditional like if: failure, that step will be skipped and no artifact will be uploaded from that job [1][2]. In summary, the action does not have a built-in mechanism to "catch" and upload artifacts upon failure unless you explicitly configure the step to run under those conditions using GitHub Actions workflow syntax [1][3].
Citations:
🌐 Web query:
actions/upload-artifact if-no-files-found ignore continue run on failed job💡 Result:
The
if-no-files-foundinput for theactions/upload-artifactGitHub Action is used to control the behavior of the step when no files are matched by the specifiedpath. It accepts three values [1][2]: -warn(default): Prints a warning to the logs but the action completes successfully [1][2]. -error: Fails the action with an error message [1][2]. -ignore: Neither prints a warning nor fails the action [1][2]. This option does not inherently control whether the action runs on a failed job; that is a separate configuration concern [3]. To ensure that an artifact upload step executes even if previous steps in the job have failed, you must use theif: always()orif: failure()conditional expression [3]. Example usage: - uses: actions/upload-artifact@v7 if: always with: name: my-artifact path: path/to/files/ if-no-files-found: ignore In this configuration, the artifact step will always attempt to run (even if earlier steps failed) and will not error or warn if the specified files are missing [1][3][2].Citations:
Upload fetched findings even when later pipeline stages fail.
main.pywritesaquasec_scan.jsonbefore parsing, synchronization, and notification, but the artifact step is skipped after a failure by default. As written, the docs line that says every scan run uploads the artifact is only true when the whole job succeeds..github/workflows/aquasec-scan.yml#L136-L140: condition the upload on non-cancelled failures and suppress the missing-file warning.docs/security/security.md#L46-L48: either narrow the wording to successful runs or update the docs after making upload failure-safe.📍 Affects 2 files
.github/workflows/aquasec-scan.yml#L136-L140(this comment)docs/security/security.md#L46-L48🤖 Prompt for AI Agents
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.
4673f91
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.
🧩 Analysis chain
🏁 Script executed:
Length of output: 1028
🏁 Script executed:
Length of output: 3120
@tmikula-dev, verified commit4673f91: the revised documentation correctly limits artifact availability to successful scan completion, matching the workflow’s existing behavior. This resolves the finding.