Skip to content

Commit

Permalink
ci: build dist
Browse files Browse the repository at this point in the history
  • Loading branch information
NGPixel committed Jan 11, 2025
1 parent cbec079 commit 1c7c3f0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
| `additionalCommits` | A list of additional commit messages to parse in order to calculate semver. | :x: | |
| `fallbackTag` | A fallback tag to use if no valid latest tag can be found. | :x: | |
| `fromTag` | Override the tag to use when comparing against the branch in order to fetch the list of commits. | :x: | |
| `maxTagsToFetch` | Maximum number of tags to fetch from latest. | :x: | `10` |
| `maxTagsToFetch` | Maximum number of tags to fetch from latest (between `1` and `100`). | :x: | `10` |
| `noNewCommitBehavior` | Whether to exit with an error *(default)*, a warning, the current version or silently when there are no new commits since the latest tag. (Possible values: `error`, `warn`, `current` or `silent`) | :x: | `error` |
| `noVersionBumpBehavior` | Whether to exit with an error *(default)*, a warning, silently, the current version or force bump using patch when none of the commits result in a version bump. (Possible values: `error`, `warn`, `current`, `patch` or `silent`) | :x: | `error` |
| `prefix` | A prefix that will be striped when parsing tags (e.g. `foobar/`). Any other prefix will be ignored. Useful for monorepos. The prefix will be added back to the output values. | :x: | |
Expand Down
19 changes: 15 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52962,6 +52962,7 @@ async function main () {
const fromTag = core.getInput('fromTag')
const maxTagsToFetch = _.toSafeInteger(core.getInput('maxTagsToFetch') || 10)
const fetchLimit = (maxTagsToFetch < 1 || maxTagsToFetch > 100) ? 10 : maxTagsToFetch
const fallbackTag = core.getInput('fallbackTag')

const bumpTypes = {
major: core.getInput('majorList').split(',').map(p => p.trim()).filter(p => p),
Expand Down Expand Up @@ -53018,7 +53019,12 @@ async function main () {

const tagsList = _.get(tagsRaw, 'repository.refs.nodes', [])
if (tagsList.length < 1) {
return core.setFailed('Couldn\'t find the latest tag. Make sure you have at least one tag created first!')
if (fallbackTag && semver.valid(fallbackTag)) {
core.info(`Using fallback tag: ${fallbackTag}`)
latestTag = { name: fallbackTag }
} else {
return core.setFailed('Couldn\'t find the latest tag. Make sure you have at least one tag created or provide a fallbackTag!')
}
}

let idx = 0
Expand All @@ -53040,10 +53046,15 @@ async function main () {
}

if (!latestTag) {
if (prefix) {
return core.setFailed(`None of the ${fetchLimit} latest tags are valid semver or match the specified prefix!`)
if (fallbackTag && semver.valid(fallbackTag)) {
core.info(`Using fallback tag: ${fallbackTag}`)
latestTag = { name: fallbackTag }
} else {
return core.setFailed(skipInvalidTags ? `None of the ${fetchLimit} latest tags are valid semver!` : 'Latest tag is invalid (does not conform to semver)!')
if (prefix) {
return core.setFailed(`None of the ${fetchLimit} latest tags are valid semver or match the specified prefix!`)
} else {
return core.setFailed(skipInvalidTags ? `None of the ${fetchLimit} latest tags are valid semver!` : 'Latest tag is invalid (does not conform to semver)!')
}
}
}

Expand Down

0 comments on commit 1c7c3f0

Please # to comment.