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
51 changes: 49 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,34 @@ jobs:
env:
TAG: ${{ steps.tag.outputs.value }}

- name: Skip if version already on crates.io
id: crates_io
env:
TAG: ${{ steps.tag.outputs.value }}
run: |
tag="${TAG#v}"
status=$(curl -s -o /dev/null -w "%{http_code}" \
-H "User-Agent: commitor-cli-publish" \
"https://crates.io/api/v1/crates/commitor-cli/$tag")
echo "status=$status" >> "$GITHUB_OUTPUT"

- name: Publish commitor-cli
if: steps.crates_io.outputs.status != '200'
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish -p commitor-cli
run: |
set +e
out=$(cargo publish -p commitor-cli 2>&1)
rc=$?
echo "$out"
# Tolerate a version that slipped through (e.g. a prior partial
# run already published it) so the workflow doesn't fail on a
# re-run of the same release.
if echo "$out" | grep -qi "already uploaded"; then
echo "Version already published — treating as success."
exit 0
fi
exit $rc

npm:
name: Publish to npm
Expand Down Expand Up @@ -83,9 +107,32 @@ jobs:
env:
TAG: ${{ steps.tag.outputs.value }}

- name: Skip if version already on npm
id: npm_check
env:
TAG: ${{ steps.tag.outputs.value }}
run: |
tag="${TAG#v}"
if npm view "commitor-cli@$tag" version >/dev/null 2>&1; then
echo "published=true" >> "$GITHUB_OUTPUT"
else
echo "published=false" >> "$GITHUB_OUTPUT"
fi

- name: Configure npm auth
if: steps.npm_check.outputs.published != 'true'
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > npm/.npmrc

- name: Publish commitor-cli
run: npm publish --access public
if: steps.npm_check.outputs.published != 'true'
run: |
set +e
out=$(npm publish --access public 2>&1)
rc=$?
echo "$out"
if echo "$out" | grep -qi "previously published\|cannot publish over"; then
echo "Version already published — treating as success."
exit 0
fi
exit $rc
working-directory: npm
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,37 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project is in 0.x, minor versions may add, change, or remove
functionality freely; 1.0.0 marks a stable command surface.

## [0.5.0] — 2026-08-29

### Added
- `commitor revert` — undo commits produced by `commitor commit`. Unpushed
commits are rolled back with a hard reset; already-pushed commits are
reverted with `git revert`, respecting the safety of shared history.
- `commitor scan --diff-range <RANGE>` — analyze a fixed git range
(e.g. `origin/main...HEAD`) instead of the working tree, plus `--markdown`
output suited to a PR comment.
- `commitor scan --context "<title/description>"` — forward a PR's stated
intent to the model so it can weigh it against the files actually touched.
- Post-commit push in `commitor commit` — after committing, offers to push
the new branch, auto-detecting the upstream.
- Per-repo session history of `commitor commit` runs, stored at
`~/.commitor/history/<repo-id>.jsonl`.
- GitHub Action (`./action`) that runs `commitor scan --diff-range` on pull
requests and posts an updatable Markdown comment.

### Changed
- `commitor commit` gains interactive branch selection, base-branch tracking,
and an offline mode.

### Improved
- PR-scale analysis: `--diff-range` scans now always consult the backend
(the local heuristic is advisory only at PR scale), so unrelated changes
bundled in a large diff are no longer missed.

### Fixed
- Release workflow (`publish.yml`) is now idempotent — re-running a release
no longer fails on an already-published crates.io / npm version.

## [0.4.0] — 2026-08-29

### Added
Expand Down Expand Up @@ -157,5 +188,11 @@ not of the full tool.
- `commitor scan` and `commitor commit` — in active development,
coming in future 0.x releases.

[0.5.0]: https://github.com/Commitor-AI/commitor/releases/tag/v0.5.0
[0.4.0]: https://github.com/Commitor-AI/commitor/releases/tag/v0.4.0
[0.3.3]: https://github.com/Commitor-AI/commitor/releases/tag/v0.3.3
[0.3.2]: https://github.com/Commitor-AI/commitor/releases/tag/v0.3.2
[0.3.1]: https://github.com/Commitor-AI/commitor/releases/tag/v0.3.1
[0.3.0]: https://github.com/Commitor-AI/commitor/releases/tag/v0.3.0
[0.2.0]: https://github.com/Commitor-AI/commitor/releases/tag/v0.2.0
[0.1.0]: https://github.com/Commitor-AI/commitor/releases/tag/v0.1.0
2 changes: 1 addition & 1 deletion crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "commitor-cli"
version = "0.4.0"
version = "0.5.0"
edition = "2021"
description = "Catches unrelated changes bundled into commits and splits them cleanly — whole-file or hunk-level, guided by AI analysis"
license = "MIT OR Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "commitor-cli",
"version": "0.4.0",
"version": "0.5.0",
"description": "Catches unrelated changes bundled into commits and splits them cleanly — whole-file or hunk-level, guided by AI analysis",
"bin": {
"commitor": "bin/commitor.js"
Expand Down
Loading