-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #169 from drashland/chore/pre-check-release
ci: pre-check release version when releasing to node ecosystem
- Loading branch information
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const versionToPublish = Deno.args[0]; | ||
|
||
const packageJsonContents = new TextDecoder().decode( | ||
Deno.readFileSync("./package.json"), | ||
); | ||
|
||
const packageJson = JSON.parse(packageJsonContents); | ||
const packageJsonVersion = `v${packageJson.version}`; | ||
|
||
console.log("Checking package.json version with GitHub release tag version.\n"); | ||
console.log(`packge.json version: ${packageJsonVersion}`); | ||
console.log(`GitHub release version: ${versionToPublish}\n`); | ||
|
||
if (packageJsonVersion !== versionToPublish) { | ||
console.log("Version mismatch. Stopping Release workflow."); | ||
Deno.exit(1); | ||
} else { | ||
console.log("Versions match. Proceeding with Release workflow."); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters