diff --git a/.github/scripts/bump_version.py b/.github/scripts/bump_version.py index 760cd33..e79db12 100644 --- a/.github/scripts/bump_version.py +++ b/.github/scripts/bump_version.py @@ -12,7 +12,13 @@ major, minor, patch, build = map(int, m.groups()) -if label == "feature": +if label == "major": + major += 1 + minor = 0 + patch = 0 + build = 0 + +elif label == "feature": minor += 1 patch = 0 build = 0 diff --git a/.github/workflows/VALIDATION.yml b/.github/workflows/VALIDATION.yml index 3f8a3d6..d616558 100644 --- a/.github/workflows/VALIDATION.yml +++ b/.github/workflows/VALIDATION.yml @@ -62,16 +62,16 @@ jobs: const labels = pr.data.labels .map(l => l.name) .filter(l => - ["feature","patch","build"].includes(l) + ["feature","patch","build","major"].includes(l) ); if (labels.length === 0) { core.setFailed( - `PR does not contain any version labels, it must contain exactly one of the following labels - feature, patch, build` + `PR does not contain any version labels, it must contain exactly one of the following labels - major, feature, patch, build` ); } else if (labels.length > 1) { core.setFailed( - `PR contains multiple version labels, it must contain exactly one of the following labels - feature, patch, build. Found: ${labels.join(", ")}` + `PR contains multiple version labels, it must contain exactly one of the following labels - major, feature, patch, build. Found: ${labels.join(", ")}` ); } diff --git a/.github/workflows/VERSION.yml b/.github/workflows/VERSION.yml index d3f6258..e021c50 100644 --- a/.github/workflows/VERSION.yml +++ b/.github/workflows/VERSION.yml @@ -29,6 +29,7 @@ jobs: id: label run: | echo "LABEL=${{ + contains(github.event.pull_request.labels.*.name, 'major') && 'major' || contains(github.event.pull_request.labels.*.name, 'feature') && 'feature' || contains(github.event.pull_request.labels.*.name, 'patch') && 'patch' || 'build'