From 6e81759e6c41b5ffb954c302ca625c7d28983c3d Mon Sep 17 00:00:00 2001 From: Omer Preminger Date: Sat, 8 Aug 2026 22:28:05 -0400 Subject: [PATCH] fix: handle single-commit condition in commitlint.yml --- .github/workflows/commitlint.yml | 15 ++++++++++++++- CHANGELOG.md | 15 +++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index 7d4d996..d63d01b 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -15,4 +15,17 @@ jobs: - uses: actions/setup-node@v7 with: node-version: 24 - - run: npx commitlint --from "${{ github.event.pull_request.base.sha }}" --to "${{ github.event.pull_request.head.sha }}" + - name: Lint commits + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + FROM="${{ github.event.pull_request.base.sha }}" + TO="${{ github.event.pull_request.head.sha }}" + else + FROM="${{ github.event.before }}" + TO="${{ github.sha }}" + fi + if [ "$FROM" = "$TO" ]; then + npx commitlint --last + else + npx commitlint --from "$FROM" --to "$TO" + fi diff --git a/CHANGELOG.md b/CHANGELOG.md index 1696439..340302f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,17 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [0.17.49] - 2026-08-05 +## [0.17.50] - 2026-08-08 + +### Fixed + +- Handle single-commit condition in commitlint.yml workflow. + +## [0.17.49] - 2026-08-08 ### Changed - Bump `stave` to `v0.16.10`. - Bump all updatable Go dependencies to their latest versions as of this date. -### Fixed - -- Handle single-commit condition in commitlint.yml workflow. - ## [0.17.48] - 2026-08-08 ### Added @@ -727,7 +729,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.4.0] - 2025-10-30 -[unreleased]: https://github.com/preminger/goctx/compare/v0.17.49...HEAD +[unreleased]: https://github.com/preminger/goctx/compare/v0.17.50...HEAD +[0.17.50]: https://github.com/preminger/goctx/compare/v0.17.49...v0.17.50 [0.17.49]: https://github.com/preminger/goctx/compare/v0.17.48...v0.17.49 [0.17.48]: https://github.com/preminger/goctx/compare/v0.17.47...v0.17.48 [0.17.47]: https://github.com/preminger/goctx/compare/v0.17.46...v0.17.47