gh-setup-git-identity 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/release.yml +31 -0
- package/CHANGELOG.md +6 -0
- package/docs/case-studies/issue-32/README.md +162 -0
- package/docs/case-studies/issue-32/raw-logs/bun-add-command-stream-2.0.0-no-toolchain.txt +47 -0
- package/docs/case-studies/issue-32/raw-logs/bun-add-command-stream-2.4.0-no-toolchain.txt +10 -0
- package/docs/case-studies/issue-32/raw-logs/ci-run-37733836425-release-failed.txt +252 -0
- package/docs/case-studies/issue-32/raw-logs/command-stream-exit-codes.txt +4 -0
- package/docs/case-studies/issue-32/raw-logs/dry-run-fixed-publish-fails.txt +91 -0
- package/docs/case-studies/issue-32/raw-logs/dry-run-main-publish-fails.txt +81 -0
- package/docs/case-studies/issue-32/raw-logs/dry-run-rerun-after-fix.txt +195 -0
- package/docs/case-studies/issue-32/raw-logs/dry-run-rerun-before-fix.txt +198 -0
- package/docs/case-studies/issue-32/raw-logs/npm-registry-facts.txt +28 -0
- package/docs/case-studies/issue-32/raw-logs/setup-npm-fixed-node20.txt +8 -0
- package/docs/case-studies/issue-32/raw-logs/setup-npm-main-node20.txt +12 -0
- package/experiments/issue-32-command-stream-exit-codes.mjs +27 -0
- package/experiments/issue-32-pinned-helpers.mjs +27 -0
- package/experiments/issue-32-release-dry-run.sh +66 -0
- package/package.json +1 -1
- package/scripts/changeset-version.mjs +8 -4
- package/scripts/create-github-release.mjs +8 -5
- package/scripts/create-manual-changeset.mjs +4 -5
- package/scripts/format-github-release.mjs +5 -5
- package/scripts/format-release-notes.mjs +5 -5
- package/scripts/instant-version-bump.mjs +8 -5
- package/scripts/publish-to-npm.mjs +18 -12
- package/scripts/release-deps.mjs +21 -0
- package/scripts/report-release-failure.mjs +143 -0
- package/scripts/setup-npm.mjs +80 -27
- package/scripts/version-and-commit.mjs +22 -5
- package/src/cli.js +4 -1
- package/test/cli.test.js +37 -0
- package/test/release-scripts.test.js +232 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
### version-and-commit.mjs (main)
|
|
2
|
+
Parsed configuration: {
|
|
3
|
+
mode: "changeset",
|
|
4
|
+
bumpType: "",
|
|
5
|
+
description: "(none)",
|
|
6
|
+
}
|
|
7
|
+
Checking for remote changes...
|
|
8
|
+
From $WORK/origin
|
|
9
|
+
* branch main -> FETCH_HEAD
|
|
10
|
+
0bf48848c322dfaffbb0baa0ba394e9ed7d2bef4
|
|
11
|
+
0bf48848c322dfaffbb0baa0ba394e9ed7d2bef4
|
|
12
|
+
Current version: 0.8.0
|
|
13
|
+
Running changeset version...
|
|
14
|
+
|
|
15
|
+
> gh-setup-git-identity@0.8.0 changeset:version
|
|
16
|
+
> bun scripts/changeset-version.mjs
|
|
17
|
+
|
|
18
|
+
Running changeset version...
|
|
19
|
+
🦋 All files have been updated. Review them and commit at your leisure
|
|
20
|
+
|
|
21
|
+
Synchronizing package-lock.json...
|
|
22
|
+
|
|
23
|
+
up to date, audited 123 packages in 1s
|
|
24
|
+
|
|
25
|
+
13 packages are looking for funding
|
|
26
|
+
run `npm fund` for details
|
|
27
|
+
|
|
28
|
+
17 high severity vulnerabilities
|
|
29
|
+
|
|
30
|
+
To address issues that do not require attention, run:
|
|
31
|
+
npm audit fix
|
|
32
|
+
|
|
33
|
+
To address all issues (including breaking changes), run:
|
|
34
|
+
npm audit fix --force
|
|
35
|
+
|
|
36
|
+
Run `npm audit` for details.
|
|
37
|
+
|
|
38
|
+
Version bump complete with synchronized package-lock.json
|
|
39
|
+
New version: 0.8.1
|
|
40
|
+
D .changeset/fix-cli-version.md
|
|
41
|
+
M CHANGELOG.md
|
|
42
|
+
M package-lock.json
|
|
43
|
+
M package.json
|
|
44
|
+
Changes detected, committing...
|
|
45
|
+
[main ab1f228] 0.8.1
|
|
46
|
+
4 files changed, 9 insertions(+), 8 deletions(-)
|
|
47
|
+
delete mode 100644 .changeset/fix-cli-version.md
|
|
48
|
+
To $WORK/origin.git
|
|
49
|
+
0bf4884..ab1f228 main -> main
|
|
50
|
+
Version bump committed and pushed to main
|
|
51
|
+
exit=0
|
|
52
|
+
### publish-to-npm.mjs (main, changeset:publish = 'exit 1')
|
|
53
|
+
From $WORK/origin
|
|
54
|
+
* branch main -> FETCH_HEAD
|
|
55
|
+
Already up to date.
|
|
56
|
+
Current version to publish: 0.8.1
|
|
57
|
+
Checking if version 0.8.1 is already published...
|
|
58
|
+
npm error code E404
|
|
59
|
+
npm error 404 No match found for version 0.8.1
|
|
60
|
+
npm error 404
|
|
61
|
+
npm error 404 The requested resource 'gh-setup-git-identity@0.8.1' could not be found or you do not have permission to access it.
|
|
62
|
+
npm error 404
|
|
63
|
+
npm error 404 Note that you can also install from a
|
|
64
|
+
npm error 404 tarball, folder, http url, or git url.
|
|
65
|
+
npm error A complete log of this run can be found in: ~/.npm/_logs/2026-10-23T07_45_32_321Z-debug-0.log
|
|
66
|
+
Version 0.8.1 not found on npm, proceeding with publish...
|
|
67
|
+
Publish attempt 1 of 3...
|
|
68
|
+
|
|
69
|
+
> gh-setup-git-identity@0.8.1 changeset:publish
|
|
70
|
+
> exit 1
|
|
71
|
+
|
|
72
|
+
Published gh-setup-git-identity@0.8.1 to npm
|
|
73
|
+
exit=0
|
|
74
|
+
### GITHUB_OUTPUT
|
|
75
|
+
new_version=0.8.1
|
|
76
|
+
version_committed=true
|
|
77
|
+
published=true
|
|
78
|
+
published_version=0.8.1
|
|
79
|
+
### origin/main
|
|
80
|
+
ab1f228 0.8.1
|
|
81
|
+
0bf4884 seed
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
### version-and-commit.mjs (HEAD)
|
|
2
|
+
Parsed configuration: {
|
|
3
|
+
mode: "changeset",
|
|
4
|
+
bumpType: "",
|
|
5
|
+
description: "(none)",
|
|
6
|
+
}
|
|
7
|
+
Checking for remote changes...
|
|
8
|
+
From $WORK/origin
|
|
9
|
+
* branch main -> FETCH_HEAD
|
|
10
|
+
c35bdc63282241637dfc7e8c15d0ef7a4040fd91
|
|
11
|
+
c35bdc63282241637dfc7e8c15d0ef7a4040fd91
|
|
12
|
+
Current version: 0.8.0
|
|
13
|
+
Running changeset version...
|
|
14
|
+
|
|
15
|
+
> gh-setup-git-identity@0.8.0 changeset:version
|
|
16
|
+
> bun scripts/changeset-version.mjs
|
|
17
|
+
|
|
18
|
+
Running changeset version...
|
|
19
|
+
🦋 All files have been updated. Review them and commit at your leisure
|
|
20
|
+
|
|
21
|
+
Synchronizing package-lock.json...
|
|
22
|
+
|
|
23
|
+
up to date, audited 123 packages in 1s
|
|
24
|
+
|
|
25
|
+
13 packages are looking for funding
|
|
26
|
+
run `npm fund` for details
|
|
27
|
+
|
|
28
|
+
17 high severity vulnerabilities
|
|
29
|
+
|
|
30
|
+
To address issues that do not require attention, run:
|
|
31
|
+
npm audit fix
|
|
32
|
+
|
|
33
|
+
To address all issues (including breaking changes), run:
|
|
34
|
+
npm audit fix --force
|
|
35
|
+
|
|
36
|
+
Run `npm audit` for details.
|
|
37
|
+
|
|
38
|
+
Version bump complete with synchronized package-lock.json
|
|
39
|
+
New version: 0.8.1
|
|
40
|
+
D .changeset/fix-cli-version.md
|
|
41
|
+
M CHANGELOG.md
|
|
42
|
+
M package-lock.json
|
|
43
|
+
M package.json
|
|
44
|
+
Changes detected, committing...
|
|
45
|
+
[main 0f7d1f7] 0.8.1
|
|
46
|
+
4 files changed, 9 insertions(+), 8 deletions(-)
|
|
47
|
+
delete mode 100644 .changeset/fix-cli-version.md
|
|
48
|
+
To $WORK/origin.git
|
|
49
|
+
c35bdc6..0f7d1f7 main -> main
|
|
50
|
+
Version bump committed and pushed to main
|
|
51
|
+
exit=0
|
|
52
|
+
### publish-to-npm.mjs (HEAD, changeset:publish = 'exit 1')
|
|
53
|
+
From $WORK/origin
|
|
54
|
+
* branch main -> FETCH_HEAD
|
|
55
|
+
Already up to date.
|
|
56
|
+
Current version to publish: 0.8.1
|
|
57
|
+
Checking if version 0.8.1 is already published...
|
|
58
|
+
npm error code E404
|
|
59
|
+
npm error 404 No match found for version 0.8.1
|
|
60
|
+
npm error 404
|
|
61
|
+
npm error 404 The requested resource 'gh-setup-git-identity@0.8.1' could not be found or you do not have permission to access it.
|
|
62
|
+
npm error 404
|
|
63
|
+
npm error 404 Note that you can also install from a
|
|
64
|
+
npm error 404 tarball, folder, http url, or git url.
|
|
65
|
+
npm error A complete log of this run can be found in: ~/.npm/_logs/2026-10-23T07_46_45_097Z-debug-0.log
|
|
66
|
+
Version 0.8.1 not found on npm, proceeding with publish...
|
|
67
|
+
Publish attempt 1 of 3...
|
|
68
|
+
|
|
69
|
+
> gh-setup-git-identity@0.8.1 changeset:publish
|
|
70
|
+
> eval "$PUBLISH_STUB"
|
|
71
|
+
|
|
72
|
+
Publish failed, waiting 0.01s before retry...
|
|
73
|
+
Publish attempt 2 of 3...
|
|
74
|
+
|
|
75
|
+
> gh-setup-git-identity@0.8.1 changeset:publish
|
|
76
|
+
> eval "$PUBLISH_STUB"
|
|
77
|
+
|
|
78
|
+
Publish failed, waiting 0.01s before retry...
|
|
79
|
+
Publish attempt 3 of 3...
|
|
80
|
+
|
|
81
|
+
> gh-setup-git-identity@0.8.1 changeset:publish
|
|
82
|
+
> eval "$PUBLISH_STUB"
|
|
83
|
+
|
|
84
|
+
Failed to publish after 3 attempts
|
|
85
|
+
exit=1
|
|
86
|
+
### GITHUB_OUTPUT
|
|
87
|
+
new_version=0.8.1
|
|
88
|
+
version_committed=true
|
|
89
|
+
### origin/main
|
|
90
|
+
0f7d1f7 0.8.1
|
|
91
|
+
c35bdc6 seed
|
|
92
|
+
|
|
93
|
+
##### re-run of the same commit, changeset:publish succeeds
|
|
94
|
+
sh: 0: getcwd() failed: No such file or directory
|
|
95
|
+
fatal: this operation must be run in a work tree
|
|
96
|
+
warning: Clone succeeded, but checkout failed.
|
|
97
|
+
You can inspect what was checked out with 'git status'
|
|
98
|
+
and retry with 'git restore --source=HEAD :/'
|
|
99
|
+
|
|
100
|
+
### version-and-commit.mjs (HEAD)
|
|
101
|
+
Parsed configuration: {
|
|
102
|
+
mode: "changeset",
|
|
103
|
+
bumpType: "",
|
|
104
|
+
description: "(none)",
|
|
105
|
+
}
|
|
106
|
+
Checking for remote changes...
|
|
107
|
+
From $WORK/origin
|
|
108
|
+
* branch main -> FETCH_HEAD
|
|
109
|
+
c35bdc63282241637dfc7e8c15d0ef7a4040fd91
|
|
110
|
+
0f7d1f728be2b78c0006a3cd82a7c67e5ea9cde2
|
|
111
|
+
Remote main has advanced (local: c35bdc63282241637dfc7e8c15d0ef7a4040fd91, remote: 0f7d1f728be2b78c0006a3cd82a7c67e5ea9cde2)
|
|
112
|
+
This may indicate a previous attempt partially succeeded.
|
|
113
|
+
{
|
|
114
|
+
"name": "gh-setup-git-identity",
|
|
115
|
+
"version": "0.8.1",
|
|
116
|
+
"description": "A tool to setup git identity based on current gh user",
|
|
117
|
+
"type": "module",
|
|
118
|
+
"main": "src/index.js",
|
|
119
|
+
"bin": {
|
|
120
|
+
"gh-setup-git-identity": "src/cli.js"
|
|
121
|
+
},
|
|
122
|
+
"scripts": {
|
|
123
|
+
"test": "bun test",
|
|
124
|
+
"test:bun": "bun test",
|
|
125
|
+
"test:deno": "deno test --allow-all",
|
|
126
|
+
"lint": "bun build src/index.js --target=bun --format=esm --outfile=/dev/null && bun build src/cli.js --target=bun --format=esm --outfile=/dev/null",
|
|
127
|
+
"changeset": "changeset",
|
|
128
|
+
"changeset:version": "bun scripts/changeset-version.mjs",
|
|
129
|
+
"changeset:publish": "eval \"$PUBLISH_STUB\"",
|
|
130
|
+
"changeset:status": "changeset status --since=origin/main"
|
|
131
|
+
},
|
|
132
|
+
"keywords": [
|
|
133
|
+
"github",
|
|
134
|
+
"git",
|
|
135
|
+
"identity",
|
|
136
|
+
"config",
|
|
137
|
+
"cli",
|
|
138
|
+
"setup"
|
|
139
|
+
],
|
|
140
|
+
"author": "Link Foundation",
|
|
141
|
+
"license": "Unlicense",
|
|
142
|
+
"repository": {
|
|
143
|
+
"type": "git",
|
|
144
|
+
"url": "https://github.com/link-foundation/gh-setup-git-identity.git"
|
|
145
|
+
},
|
|
146
|
+
"engines": {
|
|
147
|
+
"bun": ">=1.0.0"
|
|
148
|
+
},
|
|
149
|
+
"dependencies": {
|
|
150
|
+
"lino-arguments": "^0.2.1",
|
|
151
|
+
"log-lazy": "^1.0.4",
|
|
152
|
+
"yargs": "^17.7.2"
|
|
153
|
+
},
|
|
154
|
+
"devDependencies": {
|
|
155
|
+
"@changesets/cli": "^2.29.7",
|
|
156
|
+
"test-anywhere": "^0.7.0"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
Remote version: 0.8.1
|
|
160
|
+
Rebasing on remote main to incorporate changes...
|
|
161
|
+
|
|
162
|
|
|
163
|
+
Remote main already consumed the changesets (version 0.8.1).
|
|
164
|
+
exit=0
|
|
165
|
+
### publish-to-npm.mjs (HEAD, changeset:publish = 'echo stub-published')
|
|
166
|
+
From $WORK/origin
|
|
167
|
+
* branch main -> FETCH_HEAD
|
|
168
|
+
Already up to date.
|
|
169
|
+
Current version to publish: 0.8.1
|
|
170
|
+
Checking if version 0.8.1 is already published...
|
|
171
|
+
npm error code E404
|
|
172
|
+
npm error 404 No match found for version 0.8.1
|
|
173
|
+
npm error 404
|
|
174
|
+
npm error 404 The requested resource 'gh-setup-git-identity@0.8.1' could not be found or you do not have permission to access it.
|
|
175
|
+
npm error 404
|
|
176
|
+
npm error 404 Note that you can also install from a
|
|
177
|
+
npm error 404 tarball, folder, http url, or git url.
|
|
178
|
+
npm error A complete log of this run can be found in: ~/.npm/_logs/2026-10-23T07_46_48_365Z-debug-0.log
|
|
179
|
+
Version 0.8.1 not found on npm, proceeding with publish...
|
|
180
|
+
Publish attempt 1 of 3...
|
|
181
|
+
|
|
182
|
+
> gh-setup-git-identity@0.8.1 changeset:publish
|
|
183
|
+
> eval "$PUBLISH_STUB"
|
|
184
|
+
|
|
185
|
+
stub-published
|
|
186
|
+
Published gh-setup-git-identity@0.8.1 to npm
|
|
187
|
+
exit=0
|
|
188
|
+
### GITHUB_OUTPUT
|
|
189
|
+
version_committed=false
|
|
190
|
+
already_released=true
|
|
191
|
+
new_version=0.8.1
|
|
192
|
+
published=true
|
|
193
|
+
published_version=0.8.1
|
|
194
|
+
### origin/main
|
|
195
|
+
0f7d1f7 0.8.1
|
|
196
|
+
c35bdc6 seed
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
### version-and-commit.mjs (HEAD)
|
|
2
|
+
Parsed configuration: {
|
|
3
|
+
mode: "changeset",
|
|
4
|
+
bumpType: "",
|
|
5
|
+
description: "(none)",
|
|
6
|
+
}
|
|
7
|
+
Checking for remote changes...
|
|
8
|
+
From $WORK/origin
|
|
9
|
+
* branch main -> FETCH_HEAD
|
|
10
|
+
1dc7327cd5c28b38b15efcdcb3bb853ad16ebbac
|
|
11
|
+
1dc7327cd5c28b38b15efcdcb3bb853ad16ebbac
|
|
12
|
+
Current version: 0.8.0
|
|
13
|
+
Running changeset version...
|
|
14
|
+
|
|
15
|
+
> gh-setup-git-identity@0.8.0 changeset:version
|
|
16
|
+
> bun scripts/changeset-version.mjs
|
|
17
|
+
|
|
18
|
+
Running changeset version...
|
|
19
|
+
🦋 All files have been updated. Review them and commit at your leisure
|
|
20
|
+
|
|
21
|
+
Synchronizing package-lock.json...
|
|
22
|
+
|
|
23
|
+
up to date, audited 123 packages in 1s
|
|
24
|
+
|
|
25
|
+
13 packages are looking for funding
|
|
26
|
+
run `npm fund` for details
|
|
27
|
+
|
|
28
|
+
17 high severity vulnerabilities
|
|
29
|
+
|
|
30
|
+
To address issues that do not require attention, run:
|
|
31
|
+
npm audit fix
|
|
32
|
+
|
|
33
|
+
To address all issues (including breaking changes), run:
|
|
34
|
+
npm audit fix --force
|
|
35
|
+
|
|
36
|
+
Run `npm audit` for details.
|
|
37
|
+
|
|
38
|
+
Version bump complete with synchronized package-lock.json
|
|
39
|
+
New version: 0.8.1
|
|
40
|
+
D .changeset/fix-cli-version.md
|
|
41
|
+
M CHANGELOG.md
|
|
42
|
+
M package-lock.json
|
|
43
|
+
M package.json
|
|
44
|
+
Changes detected, committing...
|
|
45
|
+
[main ea7d639] 0.8.1
|
|
46
|
+
4 files changed, 9 insertions(+), 8 deletions(-)
|
|
47
|
+
delete mode 100644 .changeset/fix-cli-version.md
|
|
48
|
+
To $WORK/origin.git
|
|
49
|
+
1dc7327..ea7d639 main -> main
|
|
50
|
+
Version bump committed and pushed to main
|
|
51
|
+
exit=0
|
|
52
|
+
### publish-to-npm.mjs (HEAD, changeset:publish = 'exit 1')
|
|
53
|
+
From $WORK/origin
|
|
54
|
+
* branch main -> FETCH_HEAD
|
|
55
|
+
Already up to date.
|
|
56
|
+
Current version to publish: 0.8.1
|
|
57
|
+
Checking if version 0.8.1 is already published...
|
|
58
|
+
npm error code E404
|
|
59
|
+
npm error 404 No match found for version 0.8.1
|
|
60
|
+
npm error 404
|
|
61
|
+
npm error 404 The requested resource 'gh-setup-git-identity@0.8.1' could not be found or you do not have permission to access it.
|
|
62
|
+
npm error 404
|
|
63
|
+
npm error 404 Note that you can also install from a
|
|
64
|
+
npm error 404 tarball, folder, http url, or git url.
|
|
65
|
+
npm error A complete log of this run can be found in: ~/.npm/_logs/2026-10-23T07_46_16_664Z-debug-0.log
|
|
66
|
+
Version 0.8.1 not found on npm, proceeding with publish...
|
|
67
|
+
Publish attempt 1 of 3...
|
|
68
|
+
|
|
69
|
+
> gh-setup-git-identity@0.8.1 changeset:publish
|
|
70
|
+
> eval "$PUBLISH_STUB"
|
|
71
|
+
|
|
72
|
+
Publish failed, waiting 0.01s before retry...
|
|
73
|
+
Publish attempt 2 of 3...
|
|
74
|
+
|
|
75
|
+
> gh-setup-git-identity@0.8.1 changeset:publish
|
|
76
|
+
> eval "$PUBLISH_STUB"
|
|
77
|
+
|
|
78
|
+
Publish failed, waiting 0.01s before retry...
|
|
79
|
+
Publish attempt 3 of 3...
|
|
80
|
+
|
|
81
|
+
> gh-setup-git-identity@0.8.1 changeset:publish
|
|
82
|
+
> eval "$PUBLISH_STUB"
|
|
83
|
+
|
|
84
|
+
Failed to publish after 3 attempts
|
|
85
|
+
exit=1
|
|
86
|
+
### GITHUB_OUTPUT
|
|
87
|
+
new_version=0.8.1
|
|
88
|
+
version_committed=true
|
|
89
|
+
### origin/main
|
|
90
|
+
ea7d639 0.8.1
|
|
91
|
+
1dc7327 seed
|
|
92
|
+
|
|
93
|
+
##### re-run of the same commit, changeset:publish succeeds
|
|
94
|
+
sh: 0: getcwd() failed: No such file or directory
|
|
95
|
+
fatal: this operation must be run in a work tree
|
|
96
|
+
warning: Clone succeeded, but checkout failed.
|
|
97
|
+
You can inspect what was checked out with 'git status'
|
|
98
|
+
and retry with 'git restore --source=HEAD :/'
|
|
99
|
+
|
|
100
|
+
### version-and-commit.mjs (HEAD)
|
|
101
|
+
Parsed configuration: {
|
|
102
|
+
mode: "changeset",
|
|
103
|
+
bumpType: "",
|
|
104
|
+
description: "(none)",
|
|
105
|
+
}
|
|
106
|
+
Checking for remote changes...
|
|
107
|
+
From $WORK/origin
|
|
108
|
+
* branch main -> FETCH_HEAD
|
|
109
|
+
1dc7327cd5c28b38b15efcdcb3bb853ad16ebbac
|
|
110
|
+
ea7d63965a6ea008dbff8bfab7b05752d8d6d5fb
|
|
111
|
+
Remote main has advanced (local: 1dc7327cd5c28b38b15efcdcb3bb853ad16ebbac, remote: ea7d63965a6ea008dbff8bfab7b05752d8d6d5fb)
|
|
112
|
+
This may indicate a previous attempt partially succeeded.
|
|
113
|
+
{
|
|
114
|
+
"name": "gh-setup-git-identity",
|
|
115
|
+
"version": "0.8.1",
|
|
116
|
+
"description": "A tool to setup git identity based on current gh user",
|
|
117
|
+
"type": "module",
|
|
118
|
+
"main": "src/index.js",
|
|
119
|
+
"bin": {
|
|
120
|
+
"gh-setup-git-identity": "src/cli.js"
|
|
121
|
+
},
|
|
122
|
+
"scripts": {
|
|
123
|
+
"test": "bun test",
|
|
124
|
+
"test:bun": "bun test",
|
|
125
|
+
"test:deno": "deno test --allow-all",
|
|
126
|
+
"lint": "bun build src/index.js --target=bun --format=esm --outfile=/dev/null && bun build src/cli.js --target=bun --format=esm --outfile=/dev/null",
|
|
127
|
+
"changeset": "changeset",
|
|
128
|
+
"changeset:version": "bun scripts/changeset-version.mjs",
|
|
129
|
+
"changeset:publish": "eval \"$PUBLISH_STUB\"",
|
|
130
|
+
"changeset:status": "changeset status --since=origin/main"
|
|
131
|
+
},
|
|
132
|
+
"keywords": [
|
|
133
|
+
"github",
|
|
134
|
+
"git",
|
|
135
|
+
"identity",
|
|
136
|
+
"config",
|
|
137
|
+
"cli",
|
|
138
|
+
"setup"
|
|
139
|
+
],
|
|
140
|
+
"author": "Link Foundation",
|
|
141
|
+
"license": "Unlicense",
|
|
142
|
+
"repository": {
|
|
143
|
+
"type": "git",
|
|
144
|
+
"url": "https://github.com/link-foundation/gh-setup-git-identity.git"
|
|
145
|
+
},
|
|
146
|
+
"engines": {
|
|
147
|
+
"bun": ">=1.0.0"
|
|
148
|
+
},
|
|
149
|
+
"dependencies": {
|
|
150
|
+
"lino-arguments": "^0.2.1",
|
|
151
|
+
"log-lazy": "^1.0.4",
|
|
152
|
+
"yargs": "^17.7.2"
|
|
153
|
+
},
|
|
154
|
+
"devDependencies": {
|
|
155
|
+
"@changesets/cli": "^2.29.7",
|
|
156
|
+
"test-anywhere": "^0.7.0"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
Remote version: 0.8.1
|
|
160
|
+
Rebasing on remote main to incorporate changes...
|
|
161
|
+
|
|
162
|
|
|
163
|
+
Current version: 0.8.1
|
|
164
|
+
Running changeset version...
|
|
165
|
+
|
|
166
|
+
> gh-setup-git-identity@0.8.1 changeset:version
|
|
167
|
+
> bun scripts/changeset-version.mjs
|
|
168
|
+
|
|
169
|
+
Running changeset version...
|
|
170
|
+
🦋 warn No unreleased changesets found, exiting.
|
|
171
|
+
|
|
172
|
+
Synchronizing package-lock.json...
|
|
173
|
+
|
|
174
|
+
up to date, audited 123 packages in 1s
|
|
175
|
+
|
|
176
|
+
13 packages are looking for funding
|
|
177
|
+
run `npm fund` for details
|
|
178
|
+
|
|
179
|
+
17 high severity vulnerabilities
|
|
180
|
+
|
|
181
|
+
To address issues that do not require attention, run:
|
|
182
|
+
npm audit fix
|
|
183
|
+
|
|
184
|
+
To address all issues (including breaking changes), run:
|
|
185
|
+
npm audit fix --force
|
|
186
|
+
|
|
187
|
+
Run `npm audit` for details.
|
|
188
|
+
|
|
189
|
+
Version bump complete with synchronized package-lock.json
|
|
190
|
+
New version: 0.8.1
|
|
191
|
+
No changes to commit
|
|
192
|
+
exit=0
|
|
193
|
+
### publish step skipped (no version_committed/already_released)
|
|
194
|
+
### GITHUB_OUTPUT
|
|
195
|
+
new_version=0.8.1
|
|
196
|
+
version_committed=false
|
|
197
|
+
### origin/main
|
|
198
|
+
ea7d639 0.8.1
|
|
199
|
+
1dc7327 seed
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
execa: '10.1.0',
|
|
3
|
+
gifenc: '^1.0.3',
|
|
4
|
+
shelljs: '0.10.0',
|
|
5
|
+
'node-pty': '^1.1.0',
|
|
6
|
+
'cross-spawn': '7.0.6',
|
|
7
|
+
'@types/shelljs': '0.10.0',
|
|
8
|
+
'@resvg/resvg-js': '^2.6.2',
|
|
9
|
+
'@xterm/headless': '^6.0.0'
|
|
10
|
+
}
|
|
11
|
+
---
|
|
12
|
+
{ 'node-pty': '^1.1.0' }
|
|
13
|
+
---
|
|
14
|
+
{ node: '^22.22.2 || ^24.15.0 || >=26.0.0' }
|
|
15
|
+
{ node: '^20.17.0 || >=22.9.0' }
|
|
16
|
+
---
|
|
17
|
+
version = '0.8.0'
|
|
18
|
+
time.modified = '2026-01-16T11:31:09.598Z'
|
|
19
|
+
---
|
|
20
|
+
# npm view command-stream time (2026-10-23)
|
|
21
|
+
"1.6.2": "2026-10-06T14:19:03.161Z",
|
|
22
|
+
"2.0.0": "2026-10-07T08:06:25.277Z",
|
|
23
|
+
"2.0.1": "2026-10-11T00:03:33.933Z",
|
|
24
|
+
"2.4.0": "2026-10-12T09:59:51.525Z"
|
|
25
|
+
# npm view command-stream@2.0.1 optionalDependencies
|
|
26
|
+
{
|
|
27
|
+
"node-pty": "^1.1.0"
|
|
28
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
10.8.2
|
|
2
|
+
Current npm version: 10.8.2
|
|
3
|
+
npm error code EBADENGINE
|
|
4
|
+
npm error engine Unsupported engine
|
|
5
|
+
npm error engine Not compatible with your version of node/npm: npm@12.2.1
|
|
6
|
+
npm error notsup Not compatible with your version of node/npm: npm@12.2.1
|
|
7
|
+
npm error notsup Required: {"node":"^22.22.2 || ^24.15.0 || >=26.0.0"}
|
|
8
|
+
npm error notsup Actual: {"npm":"10.8.2","node":"v20.20.2"}
|
|
9
|
+
npm error A complete log of this run can be found in: ~/.npm/_logs/2026-10-23T07_41_06_874Z-debug-0.log
|
|
10
|
+
10.8.2
|
|
11
|
+
Updated npm version: 10.8.2
|
|
12
|
+
exit=0
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// Shows whether `await $\`cmd\`` from the pinned command-stream rejects when
|
|
3
|
+
// the command exits non-zero, with and without shell.errexit(true).
|
|
4
|
+
// Usage: bun experiments/issue-32-command-stream-exit-codes.mjs
|
|
5
|
+
import { USE_M_URL, COMMAND_STREAM } from '../scripts/release-deps.mjs';
|
|
6
|
+
|
|
7
|
+
const { use } = eval(await (await fetch(USE_M_URL)).text());
|
|
8
|
+
const commandStream = await use(COMMAND_STREAM);
|
|
9
|
+
const { $, shell } = commandStream;
|
|
10
|
+
|
|
11
|
+
async function probe(label) {
|
|
12
|
+
try {
|
|
13
|
+
const result = await $`sh -c "exit 3"`;
|
|
14
|
+
console.log(`${label}: resolved, code=${result.code}`);
|
|
15
|
+
} catch (error) {
|
|
16
|
+
console.log(`${label}: rejected, code=${error.code}, ${error.message}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
console.log('shell.errexit available:', typeof shell?.errexit);
|
|
21
|
+
await probe('default');
|
|
22
|
+
shell.errexit(true);
|
|
23
|
+
await probe('errexit(true)');
|
|
24
|
+
const captured = await $`sh -c "exit 4"`
|
|
25
|
+
.run({ capture: true })
|
|
26
|
+
.then((r) => `resolved code=${r.code}`, (e) => `rejected code=${e.code}`);
|
|
27
|
+
console.log('errexit(true) + .run({ capture: true }):', captured);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// Loads the release-script helpers at the versions pinned in
|
|
3
|
+
// scripts/release-deps.mjs and exercises the APIs the release scripts use.
|
|
4
|
+
// Usage: bun experiments/issue-32-pinned-helpers.mjs
|
|
5
|
+
import {
|
|
6
|
+
USE_M_URL,
|
|
7
|
+
COMMAND_STREAM,
|
|
8
|
+
LINO_ARGUMENTS,
|
|
9
|
+
} from '../scripts/release-deps.mjs';
|
|
10
|
+
|
|
11
|
+
console.log({ USE_M_URL, COMMAND_STREAM, LINO_ARGUMENTS });
|
|
12
|
+
const { use } = eval(await (await fetch(USE_M_URL)).text());
|
|
13
|
+
|
|
14
|
+
const { $ } = await use(COMMAND_STREAM);
|
|
15
|
+
const echo = await $`echo hello`.run({ capture: true });
|
|
16
|
+
console.log('command-stream $ ->', JSON.stringify(echo.stdout.trim()));
|
|
17
|
+
|
|
18
|
+
const { makeConfig } = await use(LINO_ARGUMENTS);
|
|
19
|
+
const config = makeConfig({
|
|
20
|
+
yargs: ({ yargs, getenv }) =>
|
|
21
|
+
yargs.option('release-version', {
|
|
22
|
+
type: 'string',
|
|
23
|
+
default: getenv('VERSION', ''),
|
|
24
|
+
}),
|
|
25
|
+
argv: ['node', 'x', '--release-version', '1.2.3'],
|
|
26
|
+
});
|
|
27
|
+
console.log('lino-arguments makeConfig ->', config.releaseVersion);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Local dry run of the release path (version-and-commit.mjs, then
|
|
3
|
+
# publish-to-npm.mjs) against a throwaway bare git remote.
|
|
4
|
+
# `changeset:publish` is replaced by a stub, so nothing is published to npm.
|
|
5
|
+
#
|
|
6
|
+
# Usage: experiments/issue-32-release-dry-run.sh [ref] [publish-stub] [rerun]
|
|
7
|
+
# ref git ref whose scripts to run (default: HEAD)
|
|
8
|
+
# publish-stub shell command used as changeset:publish (default: "exit 1")
|
|
9
|
+
# rerun if set, then re-run both steps from the original commit
|
|
10
|
+
# with a succeeding stub, like `gh run rerun --failed`
|
|
11
|
+
set -u
|
|
12
|
+
REPO="$(cd "$(dirname "$0")/.." && pwd)"
|
|
13
|
+
REF="${1:-HEAD}"
|
|
14
|
+
export PUBLISH_STUB="${2:-exit 1}"
|
|
15
|
+
RERUN="${3:-}"
|
|
16
|
+
WORK="$(mktemp -d)"
|
|
17
|
+
trap 'rm -rf "$WORK"' EXIT
|
|
18
|
+
|
|
19
|
+
mkdir "$WORK/seed"
|
|
20
|
+
git -C "$REPO" archive "$REF" | tar x -C "$WORK/seed"
|
|
21
|
+
cd "$WORK/seed"
|
|
22
|
+
# Bring the pending changeset from main, as it was when the release failed.
|
|
23
|
+
cp "$REPO/.changeset/fix-cli-version.md" .changeset/ 2>/dev/null || true
|
|
24
|
+
node -e '
|
|
25
|
+
const fs = require("fs");
|
|
26
|
+
const p = JSON.parse(fs.readFileSync("package.json", "utf8"));
|
|
27
|
+
p.scripts["changeset:publish"] = "eval \"$PUBLISH_STUB\"";
|
|
28
|
+
fs.writeFileSync("package.json", JSON.stringify(p, null, 2) + "\n");'
|
|
29
|
+
# Shorten the 10 s retry delay for the dry run.
|
|
30
|
+
sed -i 's/const RETRY_DELAY = 10000;/const RETRY_DELAY = 10;/' scripts/publish-to-npm.mjs
|
|
31
|
+
git init -q -b main && git add -A && git -c user.name=t -c user.email=t@t commit -q -m seed
|
|
32
|
+
SEED_SHA="$(git rev-parse HEAD)"
|
|
33
|
+
git clone -q --bare . "$WORK/origin.git"
|
|
34
|
+
|
|
35
|
+
release() {
|
|
36
|
+
rm -rf "$WORK/work"
|
|
37
|
+
git clone -q "$WORK/origin.git" "$WORK/work"
|
|
38
|
+
cd "$WORK/work"
|
|
39
|
+
# Like actions/checkout: the commit that triggered the run.
|
|
40
|
+
git checkout -q -B main "$SEED_SHA"
|
|
41
|
+
bun install --silent >/dev/null 2>&1
|
|
42
|
+
export GITHUB_OUTPUT="$WORK/output"
|
|
43
|
+
: > "$GITHUB_OUTPUT"
|
|
44
|
+
echo "### version-and-commit.mjs ($REF)"
|
|
45
|
+
bun scripts/version-and-commit.mjs --mode changeset
|
|
46
|
+
echo "exit=$?"
|
|
47
|
+
if grep -qE "version_committed=true|already_released=true" "$GITHUB_OUTPUT"; then
|
|
48
|
+
echo "### publish-to-npm.mjs ($REF, changeset:publish = '$PUBLISH_STUB')"
|
|
49
|
+
bun scripts/publish-to-npm.mjs --should-pull
|
|
50
|
+
echo "exit=$?"
|
|
51
|
+
else
|
|
52
|
+
echo "### publish step skipped (no version_committed/already_released)"
|
|
53
|
+
fi
|
|
54
|
+
echo "### GITHUB_OUTPUT"
|
|
55
|
+
cat "$GITHUB_OUTPUT"
|
|
56
|
+
echo "### origin/main"
|
|
57
|
+
git -C "$WORK/origin.git" log --oneline -2 main
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
release
|
|
61
|
+
if [ -n "$RERUN" ]; then
|
|
62
|
+
echo
|
|
63
|
+
echo "##### re-run of the same commit, changeset:publish succeeds"
|
|
64
|
+
export PUBLISH_STUB="echo stub-published"
|
|
65
|
+
release
|
|
66
|
+
fi
|
package/package.json
CHANGED
|
@@ -13,13 +13,17 @@
|
|
|
13
13
|
* - command-stream: Modern shell command execution with streaming support
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
+
import { USE_M_URL, COMMAND_STREAM } from './release-deps.mjs';
|
|
17
|
+
|
|
16
18
|
// Load use-m dynamically
|
|
17
|
-
const { use } = eval(
|
|
18
|
-
await (await fetch('https://unpkg.com/use-m/use.js')).text()
|
|
19
|
-
);
|
|
19
|
+
const { use } = eval(await (await fetch(USE_M_URL)).text());
|
|
20
20
|
|
|
21
21
|
// Import command-stream for shell command execution
|
|
22
|
-
const {
|
|
22
|
+
const { $, shell } = await use(COMMAND_STREAM);
|
|
23
|
+
|
|
24
|
+
// Reject on a non-zero exit code. By default `await $` resolves, so a failed
|
|
25
|
+
// command would be reported as a success (issue #32).
|
|
26
|
+
shell.errexit(true);
|
|
23
27
|
|
|
24
28
|
try {
|
|
25
29
|
console.log('Running changeset version...');
|