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
7 changes: 5 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ on: push
jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
node: [22, 24]
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm test
# - if: github.ref == 'refs/heads/master'
Expand All @@ -20,7 +23,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 22
- run: npm ci
- run: |
cp .github/workflows/event.json /home/runner/work/_temp/_github_workflow/event.json
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- uses: actions/setup-node@v4
if: ${{ !matrix.container }}
with:
node-version: 16
node-version: 22
# the checkout belongs to another user than the container's root
- if: ${{ matrix.container }}
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 3.0.0

Breaking: the functions return a native `Promise` instead of a Bluebird promise. Bluebird methods such as `.tap()` and `.spread()` are no longer available on the result. Code that uses `await` or `.then()` does not change.

- The only runtime dependency is `debug`. `bluebird`, `execa`, `lazy-ass` and `check-more-types` are removed, which removes 22 packages from an install.
- git runs with `child_process.spawn`, without a shell, as before. When Node exits, git commands that still run are killed, as before.
- `debug` is 4.4.3.
- `package.json` no longer declares `engines`. The package is tested on Node.js 22 and 24.

Other differences from execa 1.0:

- The `node_modules/.bin` folders and the folder of the `node` binary are not added to `PATH`, so a `git` file in `node_modules/.bin` is not used.
- A signal that ends Node without an `exit` event, such as a SIGTERM sent to the Node process alone, leaves running git commands running. execa killed them. A signal sent to the process group, such as Ctrl+C in a terminal, still reaches git.
- When git prints more than 10 MB, the error is a plain `Error` with the message `stdout maxBuffer exceeded`, not a `MaxBufferError`.
- On Windows, git must be `git.exe` in `PATH`. execa also ran a `git.cmd` or `git.bat`. Git for Windows puts `git.exe` in `PATH`.

## 2.0.0

Breaking: `commitInfo()` returns other values than 1.x.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Collects Git commit info from git CLI

## Install

Requires [Node](https://nodejs.org/en/) version 8 or above.
Tested on [Node.js](https://nodejs.org/en/) 22 and 24.

```sh
npm install --save @currents/commit-info
Expand Down Expand Up @@ -42,7 +42,7 @@ Notes:

- git reports no branch for a detached checkout (`HEAD`), so the branch comes from the CI provider. Branch values from `COMMIT_INFO_BRANCH` and the CI provider are reported as they are.
- `remote` never contains a user name or password, wherever it came from. GitLab's `CI_REPOSITORY_URL`, for example, holds a job token.
- Resolves with a [Bluebird](https://github.com/petkaantonov/bluebird) promise.
- Resolves with a native `Promise`.
- If you need to debug, run with `DEBUG=commit-info` environment variable. The debug output does not contain the remote's credentials.
- When git fails and fields are still empty after the CI provider's variables, `commitInfo` prints one warning with the git error and the `COMMIT_INFO_*` variables to set. No warning when there is no repository and the CI provider's variables fill the fields, or when there is no repository and no CI provider.
- When git is not installed or not in `PATH`, all the git values are empty and the warning says that git was not found in `PATH`. Install git or set the `COMMIT_INFO_*` variables.
Expand Down
13 changes: 0 additions & 13 deletions __snapshots__/git-api-spec.js

This file was deleted.

Loading
Loading