Skip to content

Fix container scan exit handling and failure propagation#47420

Merged
pelikhan merged 2 commits into
mainfrom
copilot/fix-agent-job-failure-issue
Jul 22, 2026
Merged

Fix container scan exit handling and failure propagation#47420
pelikhan merged 2 commits into
mainfrom
copilot/fix-agent-job-failure-issue

Conversation

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

The container scan aborted when Grype reported critical findings with exit code 2, preventing result generation and obscuring diagnostics. Scan job failures also need to fail the dependent agent job.

  • Scanner execution

    • Capture expected Grype and Grant nonzero exit codes without triggering bash -e.
    • Treat Grype exit code 2 as findings, not an operational error.
  • Diagnostics

    • Log scanner errors and per-platform vulnerability summaries.
  • Failure propagation

    • Explicitly fail the agent gate when scan_image does not succeed.
grype_exit=0
grype ... --fail-on critical || grype_exit=$?

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@@ -61,7 +61,13 @@ steps:
post-steps:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot this should be a step

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the enforcement gate into the normal pre-agent steps list and recompiled the workflow in 7d93461.

Copilot AI changed the title [WIP] Add logging and fix job failure handling Fix container scan exit handling and failure propagation Jul 22, 2026
Copilot AI requested a review from pelikhan July 22, 2026 23:22
@pelikhan
pelikhan marked this pull request as ready for review July 22, 2026 23:24
Copilot AI review requested due to automatic review settings July 22, 2026 23:24
@pelikhan
pelikhan merged commit 0629ee4 into main Jul 22, 2026
2 checks passed
@pelikhan
pelikhan deleted the copilot/fix-agent-job-failure-issue branch July 22, 2026 23:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes scanner exit handling, improves diagnostics, and propagates scan failures to the agent job.

Changes:

  • Handles Grype findings exit code 2 and Grant nonzero exits safely.
  • Logs scanner errors and platform summaries.
  • Fails the agent gate when scanning fails.
Show a summary per file
File Description
.github/workflows/daily-squid-image-scan.md Updates scan and failure-handling logic.
.github/workflows/daily-squid-image-scan.lock.yml Regenerates the compiled workflow.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Medium

Copilot AI restored the copilot/fix-agent-job-failure-issue branch July 22, 2026 23:28
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.83.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants