-
Notifications
You must be signed in to change notification settings - Fork 0
fix: use PR workflow for markdown builds to respect branch protection #23
Conversation
Greptile SummaryWorkflow now creates PRs with auto-merge instead of pushing directly to main, properly respecting branch protection rules.
The Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant GH as GitHub Main Branch
participant WF as Workflow
participant Bot as GitHub Actions Bot
participant PR as Pull Request
Dev->>GH: Push code changes to main
Note over GH: Excludes README.md/INSTALL.md
GH->>WF: Trigger markdown workflow
WF->>WF: Checkout repository
WF->>WF: Setup Go environment
WF->>WF: Run go run assembly/main.go
WF->>WF: Check git status for changes
alt Changes detected
WF->>Bot: Create branch docs/markdown-update-{timestamp}
Bot->>Bot: Configure git user
Bot->>Bot: Commit changes with "docs: update generated markdown"
Bot->>GH: Push new branch
Bot->>PR: Create PR with title & body
Bot->>PR: Enable auto-merge with squash
PR->>GH: Auto-merge to main (after checks pass)
Note over GH: README.md/INSTALL.md updated
Note over WF: Workflow ignores this push (paths-ignore)
else No changes
WF->>WF: Exit without action
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 1 comment
.github/workflows/markdown.yml
Outdated
| gh pr create --title "docs: update generated markdown" --body "Auto-generated markdown update" --head "$BRANCH" | ||
| gh pr merge --auto --squash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider specifying the base branch explicitly using --base main to ensure the PR targets the correct branch
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/markdown.yml
Line: 36:37
Comment:
**style:** Consider specifying the base branch explicitly using `--base main` to ensure the PR targets the correct branch
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.Instead of pushing directly to main, the markdown workflow now creates a PR and enables auto-merge. This respects branch protection rules while still automating markdown updates.
33080b7 to
114c6a2
Compare
|
@greptileai review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 1 comment
| on: | ||
| push: | ||
| branches: | ||
| - main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: workflow will run twice per change: once on initial push to main, and again when the auto-merged PR pushes to main. consider adding a skip condition to prevent the second run when the commit author is "GitHub Actions Bot"
| on: | |
| push: | |
| branches: | |
| - main | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - 'README.md' | |
| - 'INSTALL.md' |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/markdown.yml
Line: 3:6
Comment:
**style:** workflow will run twice per change: once on initial push to `main`, and again when the auto-merged PR pushes to `main`. consider adding a skip condition to prevent the second run when the commit author is "GitHub Actions Bot"
```suggestion
on:
push:
branches:
- main
paths-ignore:
- 'README.md'
- 'INSTALL.md'
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.Skip markdown build when only README.md/INSTALL.md change, preventing the auto-merged PR from triggering another workflow run.
|
@greptileai review |
Summary
Test plan