Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/actions/ci-success/lib/monitor.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ function compileIgnorePatterns(patterns) {
}

function getInput(env, name, defaultValue) {
const key = `INPUT_${name.replace(/ /gu, '_').replace(/-/gu, '_').toUpperCase()}`;
const value = env[key];
const normalizedKey = `INPUT_${name.replace(/ /gu, '_').replace(/-/gu, '_').toUpperCase()}`;
const rawKey = `INPUT_${name.replace(/ /gu, '_').toUpperCase()}`;
const value = env[normalizedKey] ?? env[rawKey];
return value == null || value === '' ? defaultValue : value;
}

Expand Down
8 changes: 8 additions & 0 deletions .github/actions/ci-success/test/monitor.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ test('buildOptions reads inputs from the provided environment', () => {
assert.equal(options.timeoutMs, 15_000);
});

test('buildOptions supports hyphenated action input keys from GitHub runtime', () => {
const options = buildOptions({
'INPUT_GITHUB-TOKEN': 'hyphen-token',
});

assert.equal(options.githubToken, 'hyphen-token');
});

test('evaluateObservedChecks fails when any completed check fails', () => {
const result = evaluateObservedChecks(
[
Expand Down