Skip to content

Add automatic issue creation on lint/test workflow failures#22

Merged
zaxlofful merged 3 commits intomainfrom
copilot/update-lint-and-pytest-workflow
Jan 2, 2026
Merged

Add automatic issue creation on lint/test workflow failures#22
zaxlofful merged 3 commits intomainfrom
copilot/update-lint-and-pytest-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 2, 2026

Lint and pytest workflows now automatically create GitHub issues when failures occur on main branch pushes.

Changes

  • Workflow modifications: Added issues: write permission and continue-on-error step handling to both lint.yml and pytest.yml
  • Issue creation logic: Conditional step triggers only on main branch push failures, checks for existing open issues to prevent duplicates
  • Issue content: Includes workflow run URL, commit SHA, branch name, and local reproduction commands
  • Label management: Auto-creates lint-failure and test-failure labels if missing
  • TODO.md: Cleared completed item

Implementation

- name: Run flake8
  id: flake8
  continue-on-error: true
  run: ./.venv/bin/python -m flake8 -q

- name: Create issue on failure
  if: steps.flake8.outcome == 'failure' && github.event_name == 'push' && github.ref == 'refs/heads/main'
  run: |
    # Check for existing open issues, create label if needed, then create issue

Pattern follows existing check-todo.yml workflow for consistency.

Original prompt

This section details on the original issue you should resolve

<issue_title>Process TODO.md items - 2026-01-02</issue_title>
<issue_description>@copilot

Please process the following TODO items from TODO.md and create a PR with the necessary changes.

Before creating the final commit or PR, run the repository linter and tests and fix any failures:

  • Run the linter: flake8
  • Run the test suite: pytest

Only create the final PR/commit when both the linter and tests pass. Include the linter and test results in the PR description or a CI run log.

Now apply the requested changes for the TODOs below and open a branch+PR when complete:

1. Update the Lint and pytest workflow to include a step, that upon failure; creates an issue and/or automated workflow to fix the problem```

After completing the work, please update TODO.md accordingly (remove completed items or mark as done).
</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

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 2, 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 7ba768e Jan 02 2026, 11:04 PM

Copilot AI changed the title [WIP] Process TODO items from TODO.md Add automatic issue creation on lint/test workflow failures Jan 2, 2026
Copilot AI requested a review from zaxlofful January 2, 2026 22:33
@zaxlofful zaxlofful marked this pull request as ready for review January 2, 2026 22:53
Copilot AI review requested due to automatic review settings January 2, 2026 22:53
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 implements automatic GitHub issue creation when lint or test workflows fail on the main branch, addressing a TODO item. The implementation follows the established pattern from check-todo.yml for consistency.

Key Changes

  • Added automatic issue creation on failure with duplicate detection via label-based querying
  • Modified both lint.yml and pytest.yml to use continue-on-error with conditional issue creation steps
  • Completed and removed the corresponding TODO item from TODO.md

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/lint.yml Added issues: write permission, continue-on-error handling for flake8 step, conditional issue creation on main branch failures with duplicate prevention, and final failure step to maintain workflow status
.github/workflows/pytest.yml Added issues: write permission, continue-on-error handling for pytest step, conditional issue creation on main branch failures with duplicate prevention, and final failure step to maintain workflow status
TODO.md Removed completed TODO item about workflow failure handling

@zaxlofful zaxlofful merged commit c8fefdf into main Jan 2, 2026
2 of 3 checks passed
@zaxlofful zaxlofful deleted the copilot/update-lint-and-pytest-workflow branch January 2, 2026 23: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.

Process TODO.md items - 2026-01-02

3 participants