Skip to content
This repository was archived by the owner on Jul 9, 2024. It is now read-only.

Commit 7bb8e09

Browse files
authored
fix: git ownership issue (#72)
1 parent 79c90c7 commit 7bb8e09

File tree

2 files changed

+38
-35
lines changed

2 files changed

+38
-35
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ jobs:
174174
with:
175175
token: ${{ secrets.GH_AUTH_SECRET }}
176176

177+
- name: Fix git permissions
178+
run: git config --global --add safe.directory "*"
179+
177180
- name: Publish action ${{ matrix.package }}
178181
if: ${{ contains(needs.setup.outputs.matrix, matrix.package) }}
179182
uses: e-square-io/.github/.github/actions/push-to-repo@main

packages/utils/src/lib/inputs.ts

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,41 @@ export function getStringArrayInput(
2626
.map((value) => value.trim());
2727
}
2828

29+
export function getBaseInputs(
30+
core: typeof Core,
31+
mode: Parameters<typeof splitArgsIntoNxArgsAndOverrides>[1]
32+
): BaseInputs {
33+
const debug = core.getBooleanInput('debug');
34+
const workingDirectory = core.getInput('workingDirectory');
35+
36+
logger(core).debugMode = debug;
37+
38+
if (workingDirectory?.length > 0) {
39+
log(`🏃 Working in custom directory: ${workingDirectory}`);
40+
process.env.NX_WORKSPACE_ROOT_PATH = workingDirectory;
41+
process.chdir(workingDirectory);
42+
}
43+
44+
return {
45+
args: getArgsInput(core, mode),
46+
debug,
47+
workingDirectory,
48+
};
49+
}
50+
51+
export function getArgsInput(
52+
core: typeof Core,
53+
mode: Parameters<typeof splitArgsIntoNxArgsAndOverrides>[1] = 'print-affected',
54+
options?: Core.InputOptions
55+
): NxArgs {
56+
const args = getStringArrayInput(core, 'args', /[= ]/g, options);
57+
const { nxArgs, overrides } = splitArgsIntoNxArgsAndOverrides({ _: args, $0: '' }, mode, {
58+
printWarnings: false,
59+
}) ?? { nxArgs: {}, overrides: {} };
60+
61+
return parseNxArgs({ ...nxArgs, ...overrides });
62+
}
63+
2964
export function parseNxArgs(args: Record<string, unknown>): NxArgs {
3065
const aliasArgs: Record<string, keyof NxArgs> = { c: 'configuration' };
3166
const arrArgs: (keyof NxArgs)[] = ['exclude', 'projects', 'files'];
@@ -64,19 +99,6 @@ export function shouldRunWithDeps(target: string): boolean {
6499
}
65100
}
66101

67-
export function getArgsInput(
68-
core: typeof Core,
69-
mode: Parameters<typeof splitArgsIntoNxArgsAndOverrides>[1] = 'print-affected',
70-
options?: Core.InputOptions
71-
): NxArgs {
72-
const args = getStringArrayInput(core, 'args', /[= ]/g, options);
73-
const { nxArgs, overrides } = splitArgsIntoNxArgsAndOverrides({ _: args, $0: '' }, mode, {
74-
printWarnings: false,
75-
}) ?? { nxArgs: {}, overrides: {} };
76-
77-
return parseNxArgs({ ...nxArgs, ...overrides });
78-
}
79-
80102
export function getMaxDistribution(
81103
core: typeof Core,
82104
targets: string | string[],
@@ -112,25 +134,3 @@ export function getMaxDistribution(
112134

113135
return reduceTargetsDistribution(maybeNumberValue);
114136
}
115-
116-
export function getBaseInputs(
117-
core: typeof Core,
118-
mode: Parameters<typeof splitArgsIntoNxArgsAndOverrides>[1]
119-
): BaseInputs {
120-
const debug = core.getBooleanInput('debug');
121-
const workingDirectory = core.getInput('workingDirectory');
122-
123-
logger(core).debugMode = debug;
124-
125-
if (workingDirectory?.length > 0) {
126-
log(`🏃 Working in custom directory: ${workingDirectory}`);
127-
process.env.NX_WORKSPACE_ROOT_PATH = workingDirectory;
128-
process.chdir(workingDirectory);
129-
}
130-
131-
return {
132-
args: getArgsInput(core, mode),
133-
debug,
134-
workingDirectory,
135-
};
136-
}

0 commit comments

Comments
 (0)