Skip to content

Commit

Permalink
fix(semantic-release): remove hotfix for v4 of the action
Browse files Browse the repository at this point in the history
This reverts commit a7c1a51.
  • Loading branch information
tagoro9 committed May 20, 2024
1 parent ec1516e commit d70ebbd
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 31 deletions.
2 changes: 1 addition & 1 deletion semantic-release/dist/index.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions semantic-release/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,10 @@ interface Inputs {
*/
async function runNpmInstall(packages: string[]) {
info(`Installing packages in ${path.resolve(__dirname, "..")}`);
// Hotfix for v4 of this action. There was a major release of @open-turo/semantic-release-config that breaks this action
// If v4 of this action is asking to install that module, pin it to the latest version
const actualPackages = packages.map((package_) => {
if (package_.includes("@open-turo/semantic-release-config")) {
return "@open-turo/[email protected]";
}
return package_;
});
const silentFlag = process.env.RUNNER_DEBUG === "1" ? "" : "--silent";
const data = await getExecOutput(
"npm",
["install", ...actualPackages, "--no-audit", silentFlag],
["install", ...packages, "--no-audit", silentFlag],
{
cwd: path.resolve(__dirname, ".."),
},
Expand Down
20 changes: 0 additions & 20 deletions semantic-release/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,26 +264,6 @@ describe("semantic-release", () => {
`);
});

test("pins @open-turo/semantic-release-config if asked as extra plugin", async () => {
process.env.SEMANTIC_ACTION_EXTRA_PLUGINS =
"@open-turo/semantic-release-config";
mockNpmInstall();
mockRelease({ nextRelease: undefined });
await callAction();
expect(getExecOutputMock).toHaveBeenCalledTimes(1);
const [cmd, arguments_] = getExecOutputMock.mock.calls[0];
expect(cmd).toMatchInlineSnapshot(`"npm"`);
expect(arguments_).toMatchInlineSnapshot(`
[
"install",
"semantic-release",
"@open-turo/[email protected]",
"--no-audit",
"--silent",
]
`);
});

test("propagates npm install errors", async () => {
mockNpmInstall({
exitCode: 1,
Expand Down

0 comments on commit d70ebbd

Please sign in to comment.