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
28 changes: 9 additions & 19 deletions .git-hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
#!/usr/bin/env bash
# Commit-msg hook: enforces Conventional Commits format.
# See: https://www.conventionalcommits.org/
# Commit-msg hook: enforces Conventional Commits format via commitlint.
# See: https://www.conventionalcommits.org/ and https://commitlint.js.org/
set -euo pipefail

MSG_FILE="$1"
MSG=$(head -1 "$MSG_FILE")

# Allow merge commits and fixup/squash commits.
if [[ "$MSG" =~ ^Merge\ ]] || [[ "$MSG" =~ ^fixup!\ ]] || [[ "$MSG" =~ ^squash!\ ]]; then
if ! command -v pnpm >/dev/null 2>&1; then
echo "==> pnpm not found — skipping commitlint (install: https://pnpm.io/installation)"
exit 0
fi

# Conventional Commits: type(optional-scope): description
# Types: feat, fix, chore, refactor, docs, test, ci, style, perf, build, revert
PATTERN='^(feat|fix|chore|refactor|docs|test|ci|style|perf|build|revert)(\([a-z0-9._-]+\))?!?: .+'

if ! [[ "$MSG" =~ $PATTERN ]]; then
printf 'ERROR: commit message does not follow Conventional Commits format.\n\n'
printf 'Expected: type(scope): description\n'
printf 'Types: feat, fix, chore, refactor, docs, test, ci, style, perf, build, revert\n'
printf 'Examples:\n'
printf ' feat(editor): add pre-release version detection\n'
printf ' fix: handle nil pointer in scan result\n'
printf ' chore(deps): bump golang.org/x/mod to v0.18.0\n\n'
printf 'Got: %s\n' "$MSG"
exit 1
if [ ! -d node_modules/@commitlint ]; then
echo "==> commitlint not installed — skipping (run: pnpm install)"
exit 0
fi

pnpm exec commitlint --edit "$MSG_FILE"
30 changes: 30 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: PR Title

on:
pull_request:
types: [opened, edited, synchronize]

permissions:
pull-requests: read

jobs:
lint:
name: Lint PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
feat
fix
chore
refactor
docs
test
ci
style
perf
build
revert
18 changes: 18 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release Please

on:
push:
branches: [main]

permissions:
contents: write
pull-requests: write

jobs:
release-please:
name: Release Please
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
command: manifest
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ coverage.html

# Weave agent state
.weave/

# Node (commitlint)
node_modules/
4 changes: 4 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,7 @@ release:
name: upkeep
draft: false
prerelease: auto
# release-please creates the tag + GitHub Release (with the changelog as
# its body) before this tag push triggers GoReleaser — keep its notes
# intact and only attach build artifacts to the existing release.
mode: keep-existing
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.0.0"
}
3 changes: 0 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.0.0] - 2026-09-02

### Added
Expand Down Expand Up @@ -164,7 +162,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Release**: GoReleaser for macOS amd64 + arm64 binaries
- **Dependabot**: Weekly updates for Go modules and GitHub Actions

[Unreleased]: https://github.com/teknikqa/upkeep/compare/v1.0.0...HEAD
[1.0.0]: https://github.com/teknikqa/upkeep/compare/v0.11.0...v1.0.0
[0.11.0]: https://github.com/teknikqa/upkeep/compare/v0.10.0...v0.11.0
[0.10.0]: https://github.com/teknikqa/upkeep/compare/v0.9.0...v0.10.0
Expand Down
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
};
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "upkeep",
"private": true,
"packageManager": "pnpm@10.30.3",
"devDependencies": {
"@commitlint/cli": "^21.2.2",
"@commitlint/config-conventional": "^21.2.2"
}
}
Loading
Loading