Skip to content

Add automated issue creation for Docker build and security scan failures#26

Merged
zaxlofful merged 2 commits intomainfrom
copilot/create-issues-on-test-failure
Feb 2, 2026
Merged

Add automated issue creation for Docker build and security scan failures#26
zaxlofful merged 2 commits intomainfrom
copilot/create-issues-on-test-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 31, 2026

CI failures on main now create GitHub issues automatically. Test and lint workflows already had this; Docker image builds did not.

Changes

Modified .github/workflows/build-ci-image.yml:

  • Added continue-on-error: true to critical steps (Trivy scans, Docker builds)
  • Added issue creation for Docker build failures (docker-build-failure label)
  • Added issue creation for Trivy security scan failures (security-scan-failure label)
  • Both check for existing open issues by label to prevent duplicates
  • Both auto-create labels if missing
  • Only triggers on push to main

Pattern

Follows existing pattern from pytest.yml and lint.yml:

- name: Create issue on Docker build failure
  if: (steps.build-qr.outcome == 'failure' || steps.build-infra.outcome == 'failure') && 
      github.event_name == 'push' && github.ref == 'refs/heads/main'
  env:
    GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  run: |
    EXISTING_ISSUES=$(gh issue list --label "docker-build-failure" --state open --json number --limit 1)
    if [ "$EXISTING_ISSUES" != "[]" ]; then
      echo "Existing open docker build failure issue found, skipping"
      exit 0
    fi
    # Create issue with workflow run link, commit SHA, and reproduction steps

Labels

Label Triggers
docker-build-failure QR or Infra image build fails
security-scan-failure Trivy detects HIGH/CRITICAL vulnerabilities (repo, QR image, or Infra image)
Original prompt

Make it so that if any of the automated tests failed on "main" an issue is created with the output.

Also, if there is a failure during automated Docker Image creation, also make an issue.

Also, setup checking to see if a similar or even identical issue already exists.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: zaxlofful <33877007+zaxlofful@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Jan 31, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
simplewish 8bdc22f Jan 31 2026, 05:27 PM

Copilot AI changed the title [WIP] Create issues for failed automated tests and Docker image creation Add automated issue creation for Docker build and security scan failures Jan 31, 2026
Copilot AI requested a review from zaxlofful January 31, 2026 17:29
@zaxlofful zaxlofful marked this pull request as ready for review January 31, 2026 21:51
Copilot AI review requested due to automatic review settings January 31, 2026 21:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the CI image build workflow so that failures in Docker builds and Trivy security scans on main automatically open GitHub issues, aligning it with the existing pytest and lint workflows.

Changes:

  • Grants the CI image build job issues: write permission and introduces continue-on-error: true for Trivy and Docker build steps so the workflow can proceed to issue-creation logic while still recording step outcomes.
  • Adds conditional issue creation for Docker build failures with a docker-build-failure label, including label auto-creation, deduplication by label, and diagnostic/repro details.
  • Adds conditional issue creation for Trivy scan failures with a security-scan-failure label, similarly handling label creation, deduplication, and including workflow/commit context plus local reproduction commands, and adds a final step to fail the workflow if any monitored step failed.

@zaxlofful zaxlofful merged commit 9408bc3 into main Feb 2, 2026
8 of 9 checks passed
@zaxlofful zaxlofful deleted the copilot/create-issues-on-test-failure branch February 2, 2026 05:04
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