Skip to content

Conversation

sam0x17
Copy link
Contributor

@sam0x17 sam0x17 commented Feb 14, 2025

Description

This PR adds a GitHub Action that enforces clean merges from upstream branches into a pull request’s target branch. The workflow checks whether the relevant upstream branches can merge without conflicts before allowing the PR to be merged.

Workflow Behavior

  • PR into devnet-ready → Ensures devnet-ready, devnet, testnet, and main merge cleanly.
  • PR into devnet → Ensures devnet, testnet, and main merge cleanly.
  • PR into testnet → Ensures testnet and main merge cleanly.
  • PR into main → Ensures main merges cleanly.
  • PR into any other branch → Defaults to checking all four (devnet-ready, devnet, testnet, and main).

Implementation Details

  • Uses git merge --no-commit --no-ff to test merges without modifying history.
  • If any merge conflict occurs, the workflow fails, preventing the PR from merging.
  • Uses git merge --abort to clean up after each merge check.
  • Ensures full repository history is available (fetch-depth: 0).

Why This Change?

  • Prevents merge conflicts from propagating down the branch hierarchy.
  • Ensures PRs are integration-ready before merging.
  • Improves CI robustness and maintains a clean commit history.

@sam0x17 sam0x17 added the blue team defensive programming, CI, etc label Feb 14, 2025
@sam0x17 sam0x17 self-assigned this Feb 14, 2025
@sam0x17 sam0x17 requested a review from unconst as a code owner February 14, 2025 15:12
@sam0x17 sam0x17 merged commit 16cb2be into devnet-ready Feb 14, 2025
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blue team defensive programming, CI, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants