Skip to content

Commit 95c1256

Browse files
committed
make this a lot easier on myself
1 parent 0c2c4b8 commit 95c1256

File tree

3 files changed

+11
-18
lines changed

3 files changed

+11
-18
lines changed

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ inputs:
3939
description: Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch. Defaults to `false`
4040
required_contexts:
4141
required: false
42-
description: The status contexts to verify against commit status checks, separated by newlines. An empty string will run all checks; to bypass checking entirely, pass a `<<EMPTY>>` string. Defaults to `<<EMPTY>>`.
42+
description: The status contexts to verify against commit status checks, separated by commas. If this argument is `"*"`, all checks are run. If this argument is omitted, or if it's set to `"[]"`, checking is bypassed entirely. Defaults to `"[]"`.
4343

4444
debug:
4545
required: false

src/lib/input.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,16 @@ export function getOptionalInput(key: string): string | undefined {
2020
return getInput(key, { required: false, trimWhitespace: true }) || undefined;
2121
}
2222

23-
export function parseOptionalStringArrayInput(
23+
export function parseOptionalRequiredContexts(
2424
key: string
2525
): string[] | undefined {
26-
const input = getOptionalInput(key);
26+
const required_contexts = getOptionalInput(key);
2727

28-
if (input === undefined || input === "<<EMPTY>>") {
29-
return [];
28+
if (required_contexts !== '*') {
29+
if (required_contexts == undefined || required_contexts === '') {
30+
return [];
31+
} else {
32+
return required_contexts.split(',');
33+
}
3034
}
31-
32-
const strings: string[] = [];
33-
for (const line of input.split(/\r|\n/)) {
34-
strings.push(line);
35-
}
36-
37-
return strings;
3835
}

src/steps/index.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
getBooleanInput,
99
getOptionalInput,
1010
getRequiredInput,
11-
parseOptionalStringArrayInput,
11+
parseOptionalRequiredContexts,
1212
} from "../lib/input";
1313

1414
import createStart, { StartArgs } from "./start";
@@ -41,18 +41,14 @@ export async function run(
4141
deploymentID: getOptionalInput("deployment_id"),
4242
override: getBooleanInput("override", false), // default to false on start
4343
auto_merge: getBooleanInput("auto_merge", false),
44+
required_contexts: parseOptionalRequiredContexts("required_contexts"),
4445
payload,
4546
};
46-
const required_contexts = parseOptionalStringArrayInput("required_contexts")
47-
// if (required_contexts !== undefined) {
48-
// start_args["required_contexts"] = required_contexts;
49-
// };
5047
const stepArgs: StartArgs = start_args;
5148
log.debug(`'${step}' arguments`, {
5249
stepArgs,
5350
coreArgs,
5451
});
55-
log.debug(`and required_contexts: ${required_contexts}`)
5652
const { deploymentID, statusID } = await createStart(
5753
github,
5854
context,

0 commit comments

Comments
 (0)