Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to restrict publishing to greater package version only #44

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Tidying up tests
  • Loading branch information
Tohaker committed Sep 14, 2021
commit 3f54312689121b90654d91a5838d572fc6b1a610
6 changes: 5 additions & 1 deletion src/npm-publish.ts
Original file line number Diff line number Diff line change
@@ -33,9 +33,13 @@ export async function npmPublish(opts: Options = {}): Promise<Results> {
await npm.publish(manifest, options);
}

// The version should be marked as lower if we disallow decrementing the version
let type =
(options.greaterVersion && cmp === -1 && "lower") || diff || "none";

let results: Results = {
package: manifest.name,
type: (options.greaterVersion && cmp === -1 && "lower") || diff || "none",
type,
version: manifest.version.raw,
oldVersion: publishedVersion.raw,
tag: options.tag,
1 change: 0 additions & 1 deletion test/specs/action/success.spec.js
Original file line number Diff line number Diff line change
@@ -160,7 +160,6 @@ describe("GitHub Action - success tests", () => {
});

expect(cli).to.have.stderr("");
expect(cli).stdout.to.include("my-lib 0.1.0");
expect(cli).stdout.to.include(
"my-lib v0.1.0 is lower than the version published to NPM"
);