Skip to content

ci: prevent autofix push to closed pull requests#206

Merged
l50 merged 1 commit into
mainfrom
fix/pre-commit-autofix-pr-state-guard
May 16, 2026
Merged

ci: prevent autofix push to closed pull requests#206
l50 merged 1 commit into
mainfrom
fix/pre-commit-autofix-pr-state-guard

Conversation

@l50
Copy link
Copy Markdown
Contributor

@l50 l50 commented May 16, 2026

Key Changes:

  • Added PR open state check before applying and pushing autofix patches
  • Updated workflow to skip checkout, patch download, and apply steps for closed PRs
  • Improved CI safety by preventing unnecessary actions on closed or merged PRs

Added:

  • PR state verification step that uses GitHub CLI to check if the pull request is
    still open before proceeding with autofix actions

Changed:

  • Conditional execution for checkout, artifact download, and patch apply/push
    steps to run only if the PR is open, using the output from the new PR state
    verification

Removed:

  • Unconditional execution of autofix patch steps, which previously ran even for
    closed PRs

**Added:**

- Added a step to check if the pull request is still open before applying
  autofix changes, setting an output variable to control subsequent steps

**Changed:**

- Updated checkout, patch download, and patch apply steps to run only if the
  pull request is open, preventing actions on closed or merged PRs in the
  pre-commit workflow
@dreadnode-renovate-bot dreadnode-renovate-bot Bot added the area/github Changes made to github actions label May 16, 2026
@l50 l50 merged commit c6b2d4e into main May 16, 2026
9 checks passed
@l50 l50 deleted the fix/pre-commit-autofix-pr-state-guard branch May 16, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/github Changes made to github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant