Skip to content

Commit

Permalink
tryfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ganitzsh committed Nov 14, 2023
1 parent 70d4c7a commit 55e85bf
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 4,154 deletions.
3,869 changes: 0 additions & 3,869 deletions dist/19.index.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/19.index.js.map

This file was deleted.

242 changes: 0 additions & 242 deletions dist/213.index.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/213.index.js.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/293248747edf5d37944a.js

This file was deleted.

6 changes: 3 additions & 3 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions dist/install-dependencies.sh

This file was deleted.

2 changes: 1 addition & 1 deletion dist/release.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/utilities/installDependencies.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 9 additions & 16 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
import { setFailed } from '@actions/core';

import { release } from './release.js';
import { getSetFailedErrorString } from './utilities/error.js';
import { processInputAdditionalPlugins } from './utilities/inputProcessors.js';
import { installDependencies } from './utilities/installDependencies.js';
import { reportResults } from './utilities/outputParsers.js';

try {
const additionalPlugins = processInputAdditionalPlugins();
release()
.then((result): void => {
reportResults(result);
})
.catch((error: unknown): void => {

Check failure on line 11 in src/index.ts

View workflow job for this annotation

GitHub Actions / Lint

Prefer top-level await over using a promise chain
const finalErrorString = getSetFailedErrorString(error);

await installDependencies(additionalPlugins);

const { release } = await import('./release.js');

const result = await release();

reportResults(result);
} catch (error: unknown) {
const finalErrorString = getSetFailedErrorString(error);

setFailed(JSON.stringify(finalErrorString));
}
setFailed(JSON.stringify(finalErrorString));
});
4 changes: 3 additions & 1 deletion src/release.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ jest.unstable_mockModule('@actions/exec', (): unknown => ({
exec: execSpy,
}));

const { InputParameters } = await import('./utilities/inputProcessors.js');
// eslint-disable-next-line max-len
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
const { InputParameters } = require('./utilities/inputProcessors.js');

type JestSpyBooleanPromise = jest.SpiedFunction<() => Promise<boolean>>;
const optionsOverride = {
Expand Down
4 changes: 4 additions & 0 deletions src/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export const release = async (
overrideOptions?: Options,
overrideConfig?: Config,
): Promise<Result> => {
const additionalPlugins = processInputAdditionalPlugins();

await installDependencies(additionalPlugins);

const { default: semanticRelease } = await import('semantic-release');

const branches = processInputReleaseBranches();
Expand Down
Loading

0 comments on commit 55e85bf

Please sign in to comment.