Skip to content

Auto create Issue when Github Action fails #61

@fxstein

Description

@fxstein

Summary

Implement an automated GitHub Action workflow that detects failed CI/CD runs and reports them by creating or updating a GitHub Issue. This ensures visibility of build breakages without cluttering the issue tracker.

Requirements

1. Trigger on Failure

  • The workflow must detect a failure status (if: failure()) in the primary CI pipeline (e.g., tests, build, lint).

2. Issue Creation (First Occurrence)

  • If a specific failure occurs for the first time, create a new GitHub Issue.
  • Title: Clearly identify the failing workflow/branch.
  • Body:
    • Link to the specific failed Run ID.
    • Link to the Commit SHA.
    • @Mention the commit author to alert them immediately.
  • Labels: Automatically apply specific labels (e.g., ci-failure, automated) to the issue for easy filtering and categorization.

3. De-duplication & Updates

  • Before creating a new issue, search for an existing open issue matching this workflow/failure context.
  • If an open issue exists: Do not create a new one. Instead, add a comment to the existing issue with a short summary (e.g., "Recurs on run #1234, commit hash").
  • If no open issue exists: Proceed with creating a new issue.

Acceptance Criteria

  • A failed CI run creates a new Issue if none exists.
  • The new issue is automatically tagged with the defined labels (e.g., ci-failure).
  • A subsequent consecutive failure on the same workflow comments on the existing issue rather than creating a duplicate.
  • The author of the breaking commit is tagged in the issue body.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions