@yukiakai/actions-git 2.0.2 → 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 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
- repository: 'owner/repository',
43
- token: process.env.GITHUB_TOKEN!,
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
- workingDirectory: '.deploy',
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
- repository: string;
72
- token: string;
73
- branch: string;
74
- workingDirectory: string;
75
-
76
- identity: GitIdentity;
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
- Returns:
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
- ```ts
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 only exposes workflow operations. Repository initialization APIs are intentionally kept internal.
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
- # Built-in Identities
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
- The library provides reusable identities for common CI environments.
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
- ## `GITHUB_ACTIONS_IDENTITY`
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
- ```ts
97
- import {
98
- GITHUB_ACTIONS_IDENTITY,
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
- Equivalent to:
115
+ ## Pathspec inputs
103
116
 
104
- ```ts
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
- You can also provide your own identity.
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
- ```ts
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
- # PreparedGitRepository
125
+ ## `PreparedGitRepository`
123
126
 
124
- Represents a repository that has already been prepared for write operations.
125
-
126
- ---
127
+ ### `wipe(pathspecInputs)`
127
128
 
128
- ## `wipe(patterns)`
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 executes:
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
- Stage files.
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 diff --cached --quiet
156
+ git add -- <pathspecs>
166
157
  ```
167
158
 
168
- Returns:
159
+ ### `hasStagedChanges()`
169
160
 
170
- * `true` if staged changes exist.
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
- ## `commit(message)`
169
+ ### `commit(message)`
176
170
 
177
- Create a commit.
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
- # Typical Workflow
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
- identity: GITHUB_ACTIONS_IDENTITY,
209
- });
191
+ `GITHUB_ACTIONS_IDENTITY` configures the standard GitHub Actions bot identity.
210
192
 
211
- await repository.wipe(['.']);
193
+ ```ts
194
+ import {
195
+ GITHUB_ACTIONS_IDENTITY,
196
+ } from '@yukiakai/actions-git';
197
+ ```
212
198
 
213
- await repository.add(['dist']);
199
+ Equivalent to:
214
200
 
215
- if (!await repository.hasStagedChanges()) {
216
- return;
201
+ ```ts
202
+ {
203
+ name: 'github-actions[bot]',
204
+ email: 'github-actions[bot]@users.noreply.github.com',
217
205
  }
206
+ ```
218
207
 
219
- await repository.commit('deploy');
208
+ You can also provide your own identity.
220
209
 
221
- await repository.push();
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,42 +1,92 @@
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
 
8
+ interface GitInspectionResult {
9
+ exitCode: number;
10
+ }
3
11
  interface GitIdentity {
4
12
  readonly name: string;
5
13
  readonly email: string;
6
14
  }
15
+ declare enum GitInspectionOperation {
16
+ StagedChangesPresence = "stagedChangesPresence",
17
+ LocalBranchPresence = "localBranchPresence",
18
+ RemoteBranchPresence = "remoteBranchPresence"
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
+ }
7
30
 
8
- interface GitRepositoryOptions {
9
- workingDirectory: AbsoluteDirectoryPath;
31
+ interface GitRepositoryCommandExecutorOptions {
32
+ readonly workingDirectory: AbsoluteDirectoryPath;
10
33
  }
11
- declare class GitRepository {
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 {
12
45
  private options;
13
- constructor(options: GitRepositoryOptions);
14
- private execute;
15
- private executeInspectable;
16
- wipe(pattern: string[]): Promise<void>;
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>;
17
57
  setupIdentity(identity: GitIdentity): Promise<void>;
18
58
  checkout(branch: string): Promise<void>;
19
59
  checkoutOrphan(branch: string): Promise<void>;
20
60
  pull(): Promise<void>;
21
61
  pullRebase(branch: string): Promise<void>;
22
62
  commit(message: string): Promise<void>;
23
- add(pattern: string[]): Promise<void>;
63
+ add(pathspecInputs: GitRepositoryPathspecInput[]): Promise<void>;
24
64
  push(): Promise<void>;
25
65
  hasStagedChanges(): Promise<boolean>;
26
66
  hasLocalBranch(branch: string): Promise<boolean>;
27
67
  }
28
68
 
29
- type PreparedGitRepository = Omit<GitRepository, 'setupIdentity' | 'checkout' | 'checkoutOrphan' | 'pullRebase' | 'hasLocalBranch'>;
69
+ type PreparedGitRepository = Omit<GitRepository, 'setupIdentity' | 'checkout' | 'checkoutOrphan' | 'pullRebase' | 'hasLocalBranch' | 'pull'>;
30
70
 
31
71
  interface PrepareGitRepositoryOptions {
32
- readonly repository: string;
33
- readonly token: string;
72
+ readonly remote: GitRemoteOptions;
34
73
  readonly branch: string;
35
- readonly directory: AbsoluteDirectoryPath;
74
+ readonly destinationDirectory: AbsoluteDirectoryPath;
36
75
  identity: GitIdentity;
37
76
  }
38
77
  declare function prepareGitRepository(options: PrepareGitRepositoryOptions): Promise<PreparedGitRepository>;
39
78
 
40
79
  declare const GITHUB_ACTIONS_IDENTITY: GitIdentity;
41
80
 
42
- export { type AbsoluteDirectoryPath, GITHUB_ACTIONS_IDENTITY, type GitIdentity, GitRepository, type PrepareGitRepositoryOptions, type PreparedGitRepository, prepareGitRepository };
81
+ interface UnexpectedGitInspectionResultErrorOptions {
82
+ readonly result: GitInspectionResult;
83
+ readonly operation: GitInspectionOperation;
84
+ }
85
+ type UnexpectedGitInspectionResultErrorDetails = UnexpectedGitInspectionResultErrorOptions;
86
+ declare class UnexpectedGitInspectionResultError extends Error {
87
+ private options;
88
+ readonly details: UnexpectedGitInspectionResultErrorDetails;
89
+ constructor(options: UnexpectedGitInspectionResultErrorOptions);
90
+ }
91
+
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
- import{exec as m}from"@actions/exec";var s=class{static async execute(t){let r=await m("git",[...t.args],{cwd:t.workingDirectory})}static async inspect(t){return{exitCode:await m("git",[...t.args],{cwd:t.workingDirectory,ignoreReturnCode:!0})}}};var n=class{constructor(t){this.options=t}execute(t){return s.execute({workingDirectory:this.options.workingDirectory,args:t})}executeInspectable(t){return s.inspect({workingDirectory:this.options.workingDirectory,args:t})}async wipe(t){await this.execute(["rm","-r","-f","--ignore-unmatch",...t]),await this.execute(["clean","-fdx","--",...t])}async setupIdentity(t){await this.execute(["config","user.name",t.name]),await this.execute(["config","user.email",t.email])}async checkout(t){await this.execute(["checkout",t])}async checkoutOrphan(t){await this.execute(["checkout","--orphan",t])}async pull(){await this.execute(["pull"])}async pullRebase(t){await this.execute(["pull","--rebase","origin",t])}async commit(t){await this.execute(["commit","-m",t])}async add(t){await this.execute(["add",...t])}async push(){await this.execute(["push","--set-upstream","origin","HEAD"])}async hasStagedChanges(){let t=await this.executeInspectable(["diff","--cached","--quiet"]);if(t.exitCode===0)return!1;if(t.exitCode===1)return!0;throw new Error(`git diff failed with exit code ${t.exitCode}`)}async hasLocalBranch(t){let r=await this.executeInspectable(["show-ref","--verify","--quiet",`refs/heads/${t}`]);if(r.exitCode===0)return!0;if(r.exitCode===1)return!1;throw new Error(`Failed to resolve local branch "${t}"`)}};var c=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(["."])}};var p=class{constructor(t){this.options=t}execInspectable(t){return s.inspect({workingDirectory:void 0,args:t})}async exists(t){let r=await this.execInspectable(["ls-remote","--exit-code","--heads",this.options.repositoryUrl,t]);switch(r.exitCode){case 0:return!0;case 2:return!1;default:throw new Error([`Failed to check remote branch "${t}"`,`Repository: ${this.options.repositoryUrl}`,`Exit code: ${r.exitCode}`].join(`
2
- `))}}};import h from"path";var y=class{constructor(t){this.options=t}execute(t){return s.execute({workingDirectory:h.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 u=class{static build(t){let{token:r,repository:a}=t;return`https://x-access-token:${r}@github.com/${a}.git`}};async function d(e){let t=u.build({repository:e.repository,token:e.token}),r=new p({repositoryUrl:t}),a=new y({repositoryUrl:t,destinationDirectory:e.directory});await r.exists(e.branch)?await a.cloneAtBranch(e.branch):await a.clone();let l=new n({workingDirectory:e.directory});return await new c(l).initialize(e.branch),await l.setupIdentity(e.identity),l}var x={name:"github-actions[bot]",email:"github-actions[bot]@users.noreply.github.com"};export{x as GITHUB_ACTIONS_IDENTITY,n as GitRepository,d as prepareGitRepository};
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": "2.0.2",
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 **/*.{js,ts,json}",
15
- "format:check": "prettier --check **/*.{js,ts,json}",
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": "^1.0.1",
60
+ "@yukiakai/artifact": "^2.0.1",
61
61
  "dotenv": "^17.0.1",
62
62
  "eslint": "^9.30.0",
63
63
  "husky": "^9.1.7",