@yukiakai/actions-git 2.1.0 → 6.0.0
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/README.md +88 -95
- package/dist/public.d.ts +44 -13
- package/dist/public.js +2 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
The library handles repository setup for you—including cloning, branch initialization, and Git identity configuration—then returns a repository that is ready to commit and push.
|
|
8
8
|
|
|
9
|
+
> It is designed for GitHub Actions and other CI environments, but it does not hard-code a Git hosting provider.
|
|
10
|
+
|
|
9
11
|
---
|
|
10
12
|
|
|
11
13
|
# Features
|
|
@@ -18,6 +20,7 @@ The library handles repository setup for you—including cloning, branch initial
|
|
|
18
20
|
* Simple staging, commit and push workflow
|
|
19
21
|
* Promise-based API
|
|
20
22
|
* Fully typed
|
|
23
|
+
* Absolute, relative, and glob pathspec inputs for staging and cleanup
|
|
21
24
|
* Designed for GitHub Actions and CI
|
|
22
25
|
|
|
23
26
|
---
|
|
@@ -34,24 +37,25 @@ npm install @yukiakai/actions-git
|
|
|
34
37
|
|
|
35
38
|
```ts
|
|
36
39
|
import {
|
|
37
|
-
prepareGitRepository,
|
|
38
40
|
GITHUB_ACTIONS_IDENTITY,
|
|
41
|
+
prepareGitRepository,
|
|
39
42
|
} from '@yukiakai/actions-git';
|
|
40
43
|
|
|
41
44
|
const repository = await prepareGitRepository({
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
remote: {
|
|
46
|
+
url: 'https://github.com/owner/repository.git',
|
|
47
|
+
authentication: {
|
|
48
|
+
username: 'x-access-token',
|
|
49
|
+
password: process.env.GITHUB_TOKEN!,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
44
52
|
branch: 'gh-pages',
|
|
45
|
-
|
|
46
|
-
|
|
53
|
+
destinationDirectory: path.resolve('.deploy'),
|
|
47
54
|
identity: GITHUB_ACTIONS_IDENTITY,
|
|
48
55
|
});
|
|
49
56
|
|
|
50
57
|
await repository.wipe(['.']);
|
|
51
|
-
|
|
52
58
|
await repository.add(['dist']);
|
|
53
|
-
|
|
54
|
-
|
|
55
59
|
if (await repository.hasStagedChanges()) {
|
|
56
60
|
await repository.commit('deploy: update documentation');
|
|
57
61
|
await repository.push();
|
|
@@ -68,83 +72,76 @@ Prepare a repository for automated Git workflows.
|
|
|
68
72
|
|
|
69
73
|
```ts
|
|
70
74
|
interface PrepareGitRepositoryOptions {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
readonly remote: {
|
|
76
|
+
readonly url: string;
|
|
77
|
+
readonly authentication: {
|
|
78
|
+
readonly username: string;
|
|
79
|
+
readonly password: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
readonly branch: string;
|
|
83
|
+
readonly destinationDirectory: string;
|
|
84
|
+
readonly identity: {
|
|
85
|
+
readonly name: string;
|
|
86
|
+
readonly email: string;
|
|
87
|
+
};
|
|
77
88
|
}
|
|
78
89
|
```
|
|
79
90
|
|
|
80
|
-
|
|
91
|
+
| Option | Description |
|
|
92
|
+
| --- | --- |
|
|
93
|
+
| `remote.url` | Complete HTTP or HTTPS Git repository URL, without embedded credentials. |
|
|
94
|
+
| `remote.authentication` | HTTP Basic credentials used to access the remote. A token can be supplied as `password`. |
|
|
95
|
+
| `branch` | Branch to prepare for the workflow. |
|
|
96
|
+
| `destinationDirectory` | Absolute local directory where the repository is cloned. |
|
|
97
|
+
| `identity` | Git `user.name` and `user.email` written to the prepared repository. |
|
|
81
98
|
|
|
82
|
-
|
|
83
|
-
Promise<PreparedGitRepository>
|
|
84
|
-
```
|
|
99
|
+
If `branch` exists on the remote, the package shallow-clones that branch. Otherwise, it clones the remote's default branch, creates an orphan branch with the requested name, and removes the inherited files.
|
|
85
100
|
|
|
86
|
-
The returned repository
|
|
101
|
+
The function returns `Promise<PreparedGitRepository>`. Initialization operations stay internal; the returned repository is ready for workflow operations such as `wipe`, `add`, `commit`, and `push`.
|
|
87
102
|
|
|
88
|
-
|
|
103
|
+
## Authentication and security
|
|
89
104
|
|
|
90
|
-
|
|
105
|
+
`prepareGitRepository` supports HTTP(S) remotes with HTTP Basic authentication. The input URL must be a complete URL without a username or password; authentication is supplied separately so it can be encoded safely.
|
|
91
106
|
|
|
92
|
-
|
|
107
|
+
For GitHub, a common configuration is `x-access-token` as the username and a `GITHUB_TOKEN` or personal access token as the password. Other Git hosts can use their own HTTP Basic username and password/token convention.
|
|
93
108
|
|
|
94
|
-
|
|
109
|
+
The prepared repository uses the authenticated remote URL so that later `pull()` and `push()` operations can authenticate. Treat its `.git/config` as sensitive:
|
|
95
110
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
} from '@yukiakai/actions-git';
|
|
100
|
-
```
|
|
111
|
+
- Do not print `git remote -v` or Git configuration in CI logs.
|
|
112
|
+
- Do not upload the checkout or its `.git` directory as an artifact.
|
|
113
|
+
- Keep the checkout in an ephemeral or cleaned-up workspace when possible.
|
|
101
114
|
|
|
102
|
-
|
|
115
|
+
## Pathspec inputs
|
|
103
116
|
|
|
104
|
-
|
|
105
|
-
{
|
|
106
|
-
name: 'github-actions[bot]',
|
|
107
|
-
email: 'github-actions[bot]@users.noreply.github.com',
|
|
108
|
-
}
|
|
109
|
-
```
|
|
117
|
+
`wipe()` and `add()` accept repository pathspec inputs. These may be:
|
|
110
118
|
|
|
111
|
-
|
|
119
|
+
- Absolute file or directory paths inside the prepared repository.
|
|
120
|
+
- Paths relative to the prepared repository root.
|
|
121
|
+
- Absolute or relative glob patterns, such as `dist/**` or `packages/*/coverage/**`.
|
|
112
122
|
|
|
113
|
-
|
|
114
|
-
identity: {
|
|
115
|
-
name: 'Yuki Akai',
|
|
116
|
-
email: 'yuki@example.com',
|
|
117
|
-
}
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
---
|
|
123
|
+
Inputs are normalized to Git-compatible repository-relative pathspecs. A pathspec that resolves outside the repository is rejected.
|
|
121
124
|
|
|
122
|
-
|
|
125
|
+
## `PreparedGitRepository`
|
|
123
126
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
---
|
|
127
|
+
### `wipe(pathspecInputs)`
|
|
127
128
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
Remove tracked and untracked files.
|
|
129
|
+
Removes tracked and untracked files matching the supplied pathspecs.
|
|
131
130
|
|
|
132
131
|
```ts
|
|
133
132
|
await repository.wipe(['.']);
|
|
134
133
|
```
|
|
135
134
|
|
|
136
|
-
Internally
|
|
135
|
+
Internally, it runs the equivalent of:
|
|
137
136
|
|
|
138
137
|
```bash
|
|
139
|
-
git rm -r -f --ignore-unmatch
|
|
140
|
-
git clean -fdx
|
|
138
|
+
git rm -r -f --ignore-unmatch -- <pathspecs>
|
|
139
|
+
git clean -fdx -- <pathspecs>
|
|
141
140
|
```
|
|
142
141
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
## `add(patterns)`
|
|
142
|
+
### `add(pathspecInputs)`
|
|
146
143
|
|
|
147
|
-
|
|
144
|
+
Stages files matching the supplied pathspecs.
|
|
148
145
|
|
|
149
146
|
```ts
|
|
150
147
|
await repository.add([
|
|
@@ -153,38 +150,31 @@ await repository.add([
|
|
|
153
150
|
]);
|
|
154
151
|
```
|
|
155
152
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
## `hasStagedChanges()`
|
|
159
|
-
|
|
160
|
-
Check whether staged changes exist.
|
|
161
|
-
|
|
162
|
-
Internally executes:
|
|
153
|
+
Internally, it runs:
|
|
163
154
|
|
|
164
155
|
```bash
|
|
165
|
-
git
|
|
156
|
+
git add -- <pathspecs>
|
|
166
157
|
```
|
|
167
158
|
|
|
168
|
-
|
|
159
|
+
### `hasStagedChanges()`
|
|
169
160
|
|
|
170
|
-
|
|
171
|
-
* `false` otherwise.
|
|
161
|
+
Returns `true` when the index contains staged changes.
|
|
172
162
|
|
|
173
|
-
|
|
163
|
+
```ts
|
|
164
|
+
if (await repository.hasStagedChanges()) {
|
|
165
|
+
// Commit and push.
|
|
166
|
+
}
|
|
167
|
+
```
|
|
174
168
|
|
|
175
|
-
|
|
169
|
+
### `commit(message)`
|
|
176
170
|
|
|
177
|
-
|
|
171
|
+
Creates a commit with the configured identity.
|
|
178
172
|
|
|
179
173
|
```ts
|
|
180
|
-
await repository.commit(
|
|
181
|
-
'deploy: update documentation',
|
|
182
|
-
);
|
|
174
|
+
await repository.commit('deploy: update documentation');
|
|
183
175
|
```
|
|
184
176
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
## `push()`
|
|
177
|
+
### `push()`
|
|
188
178
|
|
|
189
179
|
Push the current checked-out branch.
|
|
190
180
|
|
|
@@ -193,32 +183,35 @@ await repository.push();
|
|
|
193
183
|
```
|
|
194
184
|
|
|
195
185
|
The current `HEAD` is pushed to `origin`.
|
|
196
|
-
|
|
186
|
+
|
|
197
187
|
---
|
|
198
188
|
|
|
199
|
-
#
|
|
200
|
-
|
|
201
|
-
```ts
|
|
202
|
-
const repository = await prepareGitRepository({
|
|
203
|
-
repository: 'owner/repository',
|
|
204
|
-
token: process.env.GITHUB_TOKEN!,
|
|
205
|
-
branch: 'gh-pages',
|
|
206
|
-
workingDirectory: '.deploy',
|
|
189
|
+
# Built-in Identities
|
|
207
190
|
|
|
208
|
-
|
|
209
|
-
});
|
|
191
|
+
`GITHUB_ACTIONS_IDENTITY` configures the standard GitHub Actions bot identity.
|
|
210
192
|
|
|
211
|
-
|
|
193
|
+
```ts
|
|
194
|
+
import {
|
|
195
|
+
GITHUB_ACTIONS_IDENTITY,
|
|
196
|
+
} from '@yukiakai/actions-git';
|
|
197
|
+
```
|
|
212
198
|
|
|
213
|
-
|
|
199
|
+
Equivalent to:
|
|
214
200
|
|
|
215
|
-
|
|
216
|
-
|
|
201
|
+
```ts
|
|
202
|
+
{
|
|
203
|
+
name: 'github-actions[bot]',
|
|
204
|
+
email: 'github-actions[bot]@users.noreply.github.com',
|
|
217
205
|
}
|
|
206
|
+
```
|
|
218
207
|
|
|
219
|
-
|
|
208
|
+
You can also provide your own identity.
|
|
220
209
|
|
|
221
|
-
|
|
210
|
+
```ts
|
|
211
|
+
identity: {
|
|
212
|
+
name: 'Yuki Akai',
|
|
213
|
+
email: 'yuki@example.com',
|
|
214
|
+
}
|
|
222
215
|
```
|
|
223
216
|
|
|
224
217
|
---
|
package/dist/public.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
type AbsoluteDirectoryPath = string;
|
|
2
|
+
type AbsoluteFilePath = string;
|
|
3
|
+
type RelativeFilePath = string;
|
|
4
|
+
type RelativeDirectoryPath = string;
|
|
5
|
+
type AbsoluteGlobPattern = string;
|
|
6
|
+
type RelativeGlobPattern = string;
|
|
2
7
|
|
|
3
8
|
interface GitInspectionResult {
|
|
4
9
|
exitCode: number;
|
|
@@ -12,35 +17,61 @@ declare enum GitInspectionOperation {
|
|
|
12
17
|
LocalBranchPresence = "localBranchPresence",
|
|
13
18
|
RemoteBranchPresence = "remoteBranchPresence"
|
|
14
19
|
}
|
|
20
|
+
type GitRepositoryPathspecInput = AbsoluteDirectoryPath | AbsoluteFilePath | RelativeFilePath | RelativeDirectoryPath | AbsoluteGlobPattern | RelativeGlobPattern;
|
|
21
|
+
type GitRepositoryPathspec = string;
|
|
22
|
+
interface GitHttpBasicAuthentication {
|
|
23
|
+
readonly username: string;
|
|
24
|
+
readonly password: string;
|
|
25
|
+
}
|
|
26
|
+
interface GitRemoteOptions {
|
|
27
|
+
readonly url: string;
|
|
28
|
+
readonly authentication: GitHttpBasicAuthentication;
|
|
29
|
+
}
|
|
15
30
|
|
|
16
|
-
interface
|
|
17
|
-
workingDirectory: AbsoluteDirectoryPath;
|
|
31
|
+
interface GitRepositoryCommandExecutorOptions {
|
|
32
|
+
readonly workingDirectory: AbsoluteDirectoryPath;
|
|
18
33
|
}
|
|
19
|
-
declare class
|
|
34
|
+
declare class GitRepositoryCommandExecutor {
|
|
35
|
+
private readonly options;
|
|
36
|
+
constructor(options: GitRepositoryCommandExecutorOptions);
|
|
37
|
+
execute(args: readonly string[]): Promise<void>;
|
|
38
|
+
inspect(args: readonly string[]): Promise<GitInspectionResult>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface GitRepositoryPathspecResolverOptions {
|
|
42
|
+
readonly repositoryDirectory: AbsoluteDirectoryPath;
|
|
43
|
+
}
|
|
44
|
+
declare class GitRepositoryPathspecResolver {
|
|
20
45
|
private options;
|
|
21
|
-
constructor(options:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
46
|
+
constructor(options: GitRepositoryPathspecResolverOptions);
|
|
47
|
+
resolve(pathspec: GitRepositoryPathspecInput): GitRepositoryPathspec;
|
|
48
|
+
resolveAll(pathspecs: GitRepositoryPathspecInput[]): GitRepositoryPathspec[];
|
|
49
|
+
private isOutsideRepository;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare class GitRepository {
|
|
53
|
+
private readonly commandExecutor;
|
|
54
|
+
private readonly pathspecResolver;
|
|
55
|
+
constructor(commandExecutor: GitRepositoryCommandExecutor, pathspecResolver: GitRepositoryPathspecResolver);
|
|
56
|
+
wipe(pathspecInputs: GitRepositoryPathspecInput[]): Promise<void>;
|
|
25
57
|
setupIdentity(identity: GitIdentity): Promise<void>;
|
|
26
58
|
checkout(branch: string): Promise<void>;
|
|
27
59
|
checkoutOrphan(branch: string): Promise<void>;
|
|
28
60
|
pull(): Promise<void>;
|
|
29
61
|
pullRebase(branch: string): Promise<void>;
|
|
30
62
|
commit(message: string): Promise<void>;
|
|
31
|
-
add(
|
|
63
|
+
add(pathspecInputs: GitRepositoryPathspecInput[]): Promise<void>;
|
|
32
64
|
push(): Promise<void>;
|
|
33
65
|
hasStagedChanges(): Promise<boolean>;
|
|
34
66
|
hasLocalBranch(branch: string): Promise<boolean>;
|
|
35
67
|
}
|
|
36
68
|
|
|
37
|
-
type PreparedGitRepository = Omit<GitRepository, 'setupIdentity' | 'checkout' | 'checkoutOrphan' | 'pullRebase' | 'hasLocalBranch'>;
|
|
69
|
+
type PreparedGitRepository = Omit<GitRepository, 'setupIdentity' | 'checkout' | 'checkoutOrphan' | 'pullRebase' | 'hasLocalBranch' | 'pull'>;
|
|
38
70
|
|
|
39
71
|
interface PrepareGitRepositoryOptions {
|
|
40
|
-
readonly
|
|
41
|
-
readonly token: string;
|
|
72
|
+
readonly remote: GitRemoteOptions;
|
|
42
73
|
readonly branch: string;
|
|
43
|
-
readonly
|
|
74
|
+
readonly destinationDirectory: AbsoluteDirectoryPath;
|
|
44
75
|
identity: GitIdentity;
|
|
45
76
|
}
|
|
46
77
|
declare function prepareGitRepository(options: PrepareGitRepositoryOptions): Promise<PreparedGitRepository>;
|
|
@@ -58,4 +89,4 @@ declare class UnexpectedGitInspectionResultError extends Error {
|
|
|
58
89
|
constructor(options: UnexpectedGitInspectionResultErrorOptions);
|
|
59
90
|
}
|
|
60
91
|
|
|
61
|
-
export { type AbsoluteDirectoryPath, GITHUB_ACTIONS_IDENTITY, type GitIdentity, GitInspectionOperation, type GitInspectionResult, GitRepository, type PrepareGitRepositoryOptions, type PreparedGitRepository, UnexpectedGitInspectionResultError, type UnexpectedGitInspectionResultErrorDetails, type UnexpectedGitInspectionResultErrorOptions, prepareGitRepository };
|
|
92
|
+
export { type AbsoluteDirectoryPath, type AbsoluteFilePath, type AbsoluteGlobPattern, GITHUB_ACTIONS_IDENTITY, type GitHttpBasicAuthentication, type GitIdentity, GitInspectionOperation, type GitInspectionResult, type GitRemoteOptions, GitRepository, type GitRepositoryPathspecInput, type PrepareGitRepositoryOptions, type PreparedGitRepository, type RelativeDirectoryPath, type RelativeFilePath, type RelativeGlobPattern, UnexpectedGitInspectionResultError, type UnexpectedGitInspectionResultErrorDetails, type UnexpectedGitInspectionResultErrorOptions, prepareGitRepository };
|
package/dist/public.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
`));this.options=
|
|
1
|
+
var a=class r extends Error{constructor(e){super(["Unexpected git inspection result.",`Operation: ${e.operation}`,`Exit code: ${e.result.exitCode}`].join(`
|
|
2
|
+
`));this.options=e;this.name=r.name,this.details=e}details};var P=(n=>(n.StagedChangesPresence="stagedChangesPresence",n.LocalBranchPresence="localBranchPresence",n.RemoteBranchPresence="remoteBranchPresence",n))(P||{});var c=class{static hasStagedChanges(t){switch(t.exitCode){case 0:return!1;case 1:return!0;default:throw new a({result:t,operation:"stagedChangesPresence"})}}static hasLocalBranch(t){switch(t.exitCode){case 0:return!0;case 1:return!1;default:throw new a({result:t,operation:"localBranchPresence"})}}static hasRemoteBranch(t){switch(t.exitCode){case 0:return!0;case 2:return!1;default:throw new a({result:t,operation:"remoteBranchPresence"})}}};var l=class{constructor(t,e){this.commandExecutor=t;this.pathspecResolver=e}async wipe(t){let e=this.pathspecResolver.resolveAll(t);await this.commandExecutor.execute(["rm","-r","-f","--ignore-unmatch","--",...e]),await this.commandExecutor.execute(["clean","-fdx","--",...e])}async setupIdentity(t){await this.commandExecutor.execute(["config","user.name",t.name]),await this.commandExecutor.execute(["config","user.email",t.email])}async checkout(t){await this.commandExecutor.execute(["checkout",t])}async checkoutOrphan(t){await this.commandExecutor.execute(["checkout","--orphan",t])}async pull(){await this.commandExecutor.execute(["pull"])}async pullRebase(t){await this.commandExecutor.execute(["pull","--rebase","origin",t])}async commit(t){await this.commandExecutor.execute(["commit","-m",t])}async add(t){let e=this.pathspecResolver.resolveAll(t);await this.commandExecutor.execute(["add","--",...e])}async push(){await this.commandExecutor.execute(["push","--set-upstream","origin","HEAD"])}async hasStagedChanges(){let t=await this.commandExecutor.inspect(["diff","--cached","--quiet"]);return c.hasStagedChanges(t)}async hasLocalBranch(t){let e=await this.commandExecutor.inspect(["show-ref","--verify","--quiet",`refs/heads/${t}`]);return c.hasLocalBranch(e)}};var u=class{constructor(t){this.git=t}async initialize(t){if(await this.git.hasLocalBranch(t)){await this.git.checkout(t);return}await this.git.checkoutOrphan(t),await this.git.wipe(["."])}};import{exec as g}from"@actions/exec";var s=class{static async execute(t){let e=await g("git",[...t.args],{cwd:t.workingDirectory})}static async inspect(t){return{exitCode:await g("git",[...t.args],{cwd:t.workingDirectory,ignoreReturnCode:!0})}}};var m=class{constructor(t){this.options=t}execInspectable(t){return s.inspect({workingDirectory:void 0,args:t})}async exists(t){let e=await this.execInspectable(["ls-remote","--exit-code","--heads",this.options.repositoryUrl,t]);return c.hasRemoteBranch(e)}};import I from"path";var h=class{constructor(t){this.options=t}execute(t){return s.execute({workingDirectory:I.dirname(this.options.destinationDirectory),args:t})}async clone(){await this.execute(["clone",this.options.repositoryUrl,this.options.destinationDirectory])}async cloneAtBranch(t){await this.execute(["clone","--depth=1","--branch",t,this.options.repositoryUrl,this.options.destinationDirectory])}};var d=class{constructor(t){this.repositoryUrl=t}withAuthentication(t){let e=new URL(this.repositoryUrl);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error("Git repository URL must use HTTP or HTTPS.");if(e.username||e.password)throw new Error("Git repository URL must not include authentication.");return e.username=t.username,e.password=t.password,e.toString()}};var R=class{constructor(t){this.options=t}async execute(t){return s.execute({workingDirectory:this.options.workingDirectory,args:t})}async inspect(t){return s.inspect({workingDirectory:this.options.workingDirectory,args:t})}};import y from"path";var x=class r extends Error{constructor(e){super(`Git path "${e.pathspec}" is outside repository "${e.repositoryDirectory}".`);this.options=e;this.name=r.name}};var G=class{constructor(t){this.options=t}resolve(t){let{repositoryDirectory:e}=this.options,n=y.resolve(e,t),p=y.relative(e,n);if(this.isOutsideRepository(p))throw new x({repositoryDirectory:e,pathspec:t});return p===""?".":p.split(y.sep).join("/")}resolveAll(t){return t.map(e=>this.resolve(e))}isOutsideRepository(t){return t===".."||t.startsWith(`..${y.sep}`)||y.isAbsolute(t)}};async function b(r){let t=new d(r.remote.url).withAuthentication(r.remote.authentication),e=new m({repositoryUrl:t}),n=new h({repositoryUrl:t,destinationDirectory:r.destinationDirectory});await e.exists(r.branch)?await n.cloneAtBranch(r.branch):await n.clone();let p=new R({workingDirectory:r.destinationDirectory}),w=new G({repositoryDirectory:r.destinationDirectory}),f=new l(p,w);return await new u(f).initialize(r.branch),await f.setupIdentity(r.identity),f}var v={name:"github-actions[bot]",email:"github-actions[bot]@users.noreply.github.com"};export{v as GITHUB_ACTIONS_IDENTITY,P as GitInspectionOperation,l as GitRepository,a as UnexpectedGitInspectionResultError,b as prepareGitRepository};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yukiakai/actions-git",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Lightweight Git client for GitHub Actions and CI workflows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/public.js",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
13
|
"test": "echo npx vitest run --reporter verbose --coverage",
|
|
14
|
-
"format": "prettier --write **/*.{
|
|
15
|
-
"format:check": "prettier --check **/*.{
|
|
14
|
+
"format": "prettier --write **/*.{ts,json,yml}",
|
|
15
|
+
"format:check": "prettier --check **/*.{ts,json,yml}",
|
|
16
16
|
"lint": "eslint src/**/*.ts",
|
|
17
17
|
"typecheck:workspace": "tsc -p tsconfig.workspace.json",
|
|
18
18
|
"generate:types": "npx type-export-builder generate -p src/_public.ts",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@eslint/js": "^9.30.1",
|
|
58
58
|
"@types/node": "^24.0.10",
|
|
59
59
|
"@vitest/coverage-v8": "^4.0.15",
|
|
60
|
-
"@yukiakai/artifact": "^
|
|
60
|
+
"@yukiakai/artifact": "^2.0.1",
|
|
61
61
|
"dotenv": "^17.0.1",
|
|
62
62
|
"eslint": "^9.30.0",
|
|
63
63
|
"husky": "^9.1.7",
|