Skip to content

Commit

Permalink
fix(typo): includes -> include
Browse files Browse the repository at this point in the history
  • Loading branch information
JPBM135 committed Jan 18, 2024
1 parent 0ca4237 commit 2ec6655
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ describe('Self-Hosted Actions Polyfill', () => {
expect(exec.exec).toHaveBeenLastCalledWith('sudo', ['apt-get', 'autoremove', '-y'], expect.anything());
});

it('should run without errors if the skip-defaults is true and includes as curl', async () => {
it('should run without errors if the skip-defaults is true and include as curl', async () => {
vitest.mocked(platform).mockReturnValue('linux');

vitest.mocked(core).getInput.mockImplementation((name: string): string => {
if (name === 'skip-defaults') {
return 'true';
}

if (name === 'includes') {
if (name === 'include') {
return 'curl';
}

Expand Down
9 changes: 4 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import { validateInputs, validatePolyfillNeeds } from './utils/validate.js';

export async function main() {
const IGNORE = core.getInput('ignored', { required: false, trimWhitespace: true })?.split(',').filter(Boolean) ?? [];
const INCLUDES =
core.getInput('includes', { required: false, trimWhitespace: true })?.split(',').filter(Boolean) ?? [];
const INCLUDE = core.getInput('include', { required: false, trimWhitespace: true })?.split(',').filter(Boolean) ?? [];
const SKIP_DEFAULTS = core.getInput('skip-defaults')
? core.getBooleanInput('skip-defaults', {
required: false,
Expand All @@ -21,7 +20,7 @@ export async function main() {
const RUN_IN_BAND = core.getInput('run-in-band') ? core.getBooleanInput('run-in-band') : false;

try {
core.debug(`Inputs: ${JSON.stringify({ IGNORE, INCLUDES, SKIP_DEFAULTS, RUN_IN_BAND }, null, 2)}`);
core.debug(`Inputs: ${JSON.stringify({ IGNORE, INCLUDE, SKIP_DEFAULTS, RUN_IN_BAND }, null, 2)}`);

const platform = os.platform();
const promises: Promise<void>[] = [];
Expand All @@ -31,7 +30,7 @@ export async function main() {
}

core.debug('Validating inputs...');
validateInputs({ ignore: IGNORE, include: INCLUDES, skipDefaults: SKIP_DEFAULTS });
validateInputs({ ignore: IGNORE, include: INCLUDE, skipDefaults: SKIP_DEFAULTS });

core.debug('Installing dependencies...');
const updateCode = await exec.exec('sudo', ['apt-get', 'update', '-y'], {
Expand All @@ -42,7 +41,7 @@ export async function main() {
throw new Error(`Apt update failed with exit code ${updateCode}.`);
}

const modulesToInstall = parseModulesToInstall({ ignore: IGNORE, include: INCLUDES, skipDefaults: SKIP_DEFAULTS });
const modulesToInstall = parseModulesToInstall({ ignore: IGNORE, include: INCLUDE, skipDefaults: SKIP_DEFAULTS });

validatePolyfillNeeds(modulesToInstall);

Expand Down
2 changes: 1 addition & 1 deletion src/utils/validate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('validateInputs', () => {

it('should throw an error if an included polyfill is unknown', () => {
expect(() => validateInputs({ ignore: [], include: ['unknown'], skipDefaults: false })).toThrow(
'Unknown polyfills on includes: unknown',
'Unknown polyfills on include: unknown',
);
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/utils/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function validateInputs({
}

validatePackageNames(ignore, 'ignored');
validatePackageNames(include, 'includes');
validatePackageNames(include, 'include');
}

export function validatePackageNames(packages: string[], source: string): void {
Expand Down

0 comments on commit 2ec6655

Please sign in to comment.