Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Changelog

on:
pull_request:
push:
branches: [main]

jobs:
changelog:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Validate git-cliff changelog generation
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --unreleased --verbose
env:
OUTPUT: /tmp/changelog-preview.md
2 changes: 1 addition & 1 deletion .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Lint Commit Messages
on:
pull_request:
push:
branches: [main, master]
branches: [main]

jobs:
commitlint:
Expand Down
21 changes: 8 additions & 13 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,12 @@ validated, and aligned with this gem's public API.
- Before finishing release-harness changes, run the focused release tests and
a `git-cliff` smoke check.

## Commit Messages
## Git Standards

- Use Conventional Commits: `feat`, `fix`, `docs`, `test`, `refactor`, or
`chore`.
- Keep the subject imperative, specific, and under 72 characters.
- Leave a blank line between the subject and body.
- Write one coherent reason per commit; split unrelated work first.
- Use the body when the reasoning matters. Explain why the change exists,
what approach was taken, and what constraints or side effects matter.
- Wrap body lines at 72 characters so commit hooks and terminal tools stay
readable.
- Avoid vague subjects such as `misc fixes`, `updates`, or `cleanup` unless
the cleanup is the actual scoped purpose.
- Mention verification in the body when it materially helps future readers.
- Use `main` as the canonical integration branch.
- Never commit directly to `main` or `master`.
- Use branches for all work.
- Use Conventional Commits with `What:`, `Why:`, and `Where:` in the body.
- Keep the subject specific and under 72 characters, with one blank line before
the body.
- Follow the `git-standards` skill for the full validation checklist.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ namespace :release do
tag = release_tag(version)

sh "git add CHANGELOG.md lib/git/markdown/version.rb"
sh %(git commit -m "chore(release): prepare v#{version}")
sh %(LEFTHOOK=0 git commit -m "chore(release): prepare v#{version}")
sh %(git tag -a #{tag} -m "Release #{tag}")
sh "git push origin #{branch}"
sh "git push origin #{tag}"
Expand Down
10 changes: 10 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@ commit-msg:
run: bundle exec commitlint --message {1}
- name: standard
run: bundle exec rake standard

pre-commit:
jobs:
- name: protect-main-master
run: |
branch=$(git branch --show-current)
if [ "$branch" = "master" ] || [ "$branch" = "main" ]; then
echo "❌ Direct commits to '$branch' are not allowed. Use a feature branch."
exit 1
fi
6 changes: 3 additions & 3 deletions lib/git/markdown/providers/github.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def fetch_reviews(owner, repo, number)
review.comments = all_pr_comments
.select { |c| c["pull_request_review_id"] == review.id }
.map do |data|
comment = Models::Comment.from_api(data)
comment.resolved = resolved_ids.include?(comment.id)
comment
comment = Models::Comment.from_api(data)
comment.resolved = resolved_ids.include?(comment.id)
comment
end
review
end
Expand Down
Loading