Skip to content

docs: configure GitHub for squash merge and auto-run workflows on Draft PRs#226

Merged
kitelev merged 5 commits intomainfrom
docs/github-config-squash-merge
Oct 31, 2025
Merged

docs: configure GitHub for squash merge and auto-run workflows on Draft PRs#226
kitelev merged 5 commits intomainfrom
docs/github-config-squash-merge

Conversation

@kitelev
Copy link
Owner

@kitelev kitelev commented Oct 31, 2025

Summary

Configures GitHub repository settings for:

  1. Squash merge only - all PR commits combined into single commit on main
  2. Auto-run workflows on Draft PRs - CI runs without manual approval
  3. Linear history - enforced via required_linear_history + squash merge

Changes Made

GitHub API Configuration

  • ✅ Enabled squash merge (allow_squash_merge: true)
  • ❌ Disabled rebase merge (allow_rebase_merge: false)
  • ❌ Merge commits already disabled
  • ✅ Auto-merge enabled (no changes needed)

Workflow Changes

File: .github/workflows/ci.yml

  • Added explicit PR event types: [opened, synchronize, reopened, ready_for_review]
  • Now triggers on Draft PRs automatically

Documentation

New file: .github/GITHUB_SETTINGS.md

  • Complete documentation of all GitHub settings
  • Verification commands for checking configuration
  • Rollback instructions
  • Workflow examples

Updated: CLAUDE.md

  • Corrected merge strategy documentation (squash merge creates NEW commit, not git rebase)
  • Updated workflow steps to include manual rebase when main changes
  • Clarified that strict: true requires manual branch updates
  • Fixed step numbering (11 → 12 steps)

How Squash Merge Works

What actually happens:

Before:
main:     A---B---C
feature:      \---D---E---F

After squash merge:
main:     A---B---C---G  (G = NEW commit with D+E+F changes)

Key points:

  • GitHub creates NEW commit on main (not git rebase)
  • All branch commits combined into single commit
  • Manual git rebase origin/main needed if main changed (strict mode)
  • Linear history maintained (no merge commit branches)

Verification

# Check merge settings
gh api repos/kitelev/exocortex-obsidian-plugin | \
  jq '{allow_squash_merge, allow_rebase_merge, allow_merge_commit}'

# Expected output:
# {
#   "allow_squash_merge": true,
#   "allow_rebase_merge": false,
#   "allow_merge_commit": false
# }

# Check branch protection
gh api repos/kitelev/exocortex-obsidian-plugin/branches/main/protection | \
  jq '{required_linear_history, required_status_checks}'

Test Plan

  • Workflow changes tested (this PR will verify auto-run on PR creation)
  • GitHub API settings applied successfully
  • Documentation created and reviewed
  • CI checks pass (automatic verification)
  • Merge via squash (verifies new merge strategy)

References

  • GitHub API: Repository settings
  • GitHub Actions: PR trigger events
  • CLAUDE.md: Development workflow guidelines

Copilot AI review requested due to automatic review settings October 31, 2025 09:22
Copy link

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 updates the repository's merge strategy from rebase-only to squash-merge-only, aligning with GitHub best practices for maintaining linear history while simplifying the merge process. The changes document the new workflow and update CI configuration to support draft PRs.

Key changes:

  • Switched from --rebase to --squash merge strategy in CLAUDE.md workflow documentation
  • Added explicit PR event types to CI workflow to trigger on draft PRs
  • Created comprehensive GITHUB_SETTINGS.md documenting all repository configurations

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
CLAUDE.md Updated workflow steps and merge strategy documentation from rebase to squash merge, added manual rebase step before merge
.github/workflows/ci.yml Added explicit PR event types to enable CI runs on draft PRs
.github/GITHUB_SETTINGS.md New comprehensive documentation of all GitHub repository settings, merge strategies, and configuration details
Comments suppressed due to low confidence (1)

CLAUDE.md:296

  • Documentation still refers to 'rebase-only' strategy, but the PR changes the merge strategy to squash-only. This should be updated to reflect the new strategy: 'Linear history REQUIRED (squash-merge-only, no merge commits)'.
- ✅ Linear history REQUIRED (rebase-only, no merge commits)


2. **Updated via GitHub API:** Repository merge settings
- Enabled squash merge (was disabled)
- Kept rebase merge enabled
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

Documentation states 'Kept rebase merge enabled' but line 35 shows allow_rebase_merge: false and line 44 states 'Regular rebase disabled'. This is contradictory. The documentation should state 'Disabled rebase merge' to match the actual configuration.

Suggested change
- Kept rebase merge enabled
- Disabled rebase merge

Copilot uses AI. Check for mistakes.
…ft PRs

Changes:
- Enable squash merge only (disable rebase merge) via GitHub API
- Configure workflows to run automatically on Draft PRs
- Add comprehensive documentation in .github/GITHUB_SETTINGS.md
- Update CLAUDE.md with accurate squash merge workflow
- Clarify that squash merge creates new commit (not git rebase)

Result:
- All PR merges → single squash commit on main
- Linear history maintained (no merge commits)
- CI runs automatically on Draft PRs without approval
- Manual rebase required if main changes (strict mode)
- Fix TypeScript error TS2345 in lines 69 and 118
- Add instanceof Error check before passing to LoggingService.error()
- Ensures type safety when logging caught errors
@kitelev kitelev force-pushed the docs/github-config-squash-merge branch from 78d43ea to cfad667 Compare October 31, 2025 09:34
- Remove unused 'parsed' variable in AssetConversionService
- Add _ prefix to unused vaultAdapter in Convert commands
- Fixes TS6133 and TS6138 errors from PR #223
- Remove vaultAdapter from constructor signatures
- Update CommandRegistry to not pass vaultAdapter
- Update unit tests to match new constructor signatures
- Fixes TS6138 errors for unused parameters
- Remove ObsidianVaultAdapter imports from Convert commands
- Fixes TS6133 errors for unused imports
@kitelev kitelev merged commit 265cc12 into main Oct 31, 2025
9 checks passed
@kitelev kitelev deleted the docs/github-config-squash-merge branch October 31, 2025 09:49
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.

2 participants