Skip to content

Commit

Permalink
trigger build (#188)
Browse files Browse the repository at this point in the history
get latest version from release tag name if name not set
  • Loading branch information
michaelnlindsay authored Jul 3, 2024
1 parent b64b52d commit f1b2e9e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions .github/actions-scripts/validate-release-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,26 @@ async function validateReleaseVersion() {

const { version } = require(`${workspace}/package.json`);

var latest_version = "1.1.1"

const { data: latest } = await octokit.request(`GET /repos/${owner}/${repo}/releases/latest`, gh_api_header)

if (latest.name) {
latest_version = latest.name
} else if (latest.tag_name) {
latest_version = latest.tag_name.replace('v','')
} else {
console.log("Unable to determine latest version: ", latest)
process.exit(1);
}

// Version set in package.json must be greater than latest
console.log("Package Version: ", version, "Latest Version: ", latest.name)
if (! semver.gt(version, latest.name)) {
console.log("version property in package.json must be greater than: ", latest.name)
console.log("Package Version: ", version, "Latest Version: ", latest_version)
if (! semver.gt(version, latest_version)) {
console.log("version property in package.json must be greater than: ", latest_version)
process.exit(1);
}

return version;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hellosign-embedded",
"version": "2.12.0",
"version": "2.12.1",
"description": "Embed HelloSign signature requests and templates from within your web application.",
"main": "index.js",
"license": "MIT",
Expand Down

0 comments on commit f1b2e9e

Please sign in to comment.