Repository navigation
ci: add main branch guard workflow - #44
Merged
Merged
Conversation
- Add squad-main-guard.yml workflow that fails PRs to main containing: - .ai-team/** (all team state files, zero exceptions) - team-docs/** except team-docs/blog/** (blog is allowed) - Uses GitHub API (pulls.listFiles) for accurate PR file detection - Error message includes exact fix commands (git rm --cached) - Placed in both templates/workflows/ and .github/workflows/ - Updated .gitignore with explicit warning against force-adding .ai-team/
Closed
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a GitHub Actions workflow (
squad-main-guard.yml) that blocks PRs to main from containing forbidden paths:.ai-team/**— ALL team state files, zero exceptionsteam-docs/**— internal team content (exceptteam-docs/blog/**, which is allowed)Why
.ai-team/files (121+ team state files) have repeatedly leaked intomainvia PR merges fromdev. Even though.ai-team/is in.gitignore, files previously force-added withgit add -fremain tracked and flow through merges..gitignoreis a request — CI is enforcement.How it works
pull_requesttargetingmain(opened, synchronize, reopened)pulls.listFiles) to get the full list of changed files in the PRFiles changed
templates/workflows/squad-main-guard.yml— reusable template for distribution.github/workflows/squad-main-guard.yml— active on this repo.gitignore— updated with explicit warning against force-adding.ai-team/Error output example
When forbidden files are detected, the contributor sees:
git rm --cachedcommands to fix it