Skip to content

Commit

Permalink
fix: missing build from latest commit
Browse files Browse the repository at this point in the history
  • Loading branch information
NGPixel committed Jan 16, 2024
1 parent 1454181 commit 4024143
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 16 deletions.
29 changes: 21 additions & 8 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52961,7 +52961,7 @@ async function main () {
const additionalCommits = core.getInput('additionalCommits').split('\n').map(l => l.trim()).filter(l => l !== '')
const fromTag = core.getInput('fromTag')
const maxTagsToFetch = _.toSafeInteger(core.getInput('maxTagsToFetch') || 10)
const maxTagsToFetchSafe = maxTagsToFetch < 1 || maxTagsToFetch > 100 ? 10 : maxTagsToFetch
const fetchLimit = (maxTagsToFetch < 1 || maxTagsToFetch > 100) ? 10 : maxTagsToFetch

const bumpTypes = {
major: core.getInput('majorList').split(',').map(p => p.trim()).filter(p => p),
Expand All @@ -52986,9 +52986,20 @@ async function main () {
// GET LATEST + PREVIOUS TAGS

const tagsRaw = await gh.graphql(`
query lastTags ($owner: String!, $repo: String!) {
repository (owner: $owner, name: $repo) {
refs(first: maxTagsToFetchSafe, refPrefix: "refs/tags/", orderBy: { field: TAG_COMMIT_DATE, direction: DESC }) {
query lastTags (
$owner: String!
$repo: String!
$fetchLimit: Int
) {
repository (
owner: $owner
name: $repo
) {
refs(
first: $fetchLimit
refPrefix: "refs/tags/"
orderBy: { field: TAG_COMMIT_DATE, direction: DESC }
) {
nodes {
name
target {
Expand All @@ -52998,9 +53009,11 @@ async function main () {
}
}
}
`, {
`,
{
owner,
repo
repo,
fetchLimit
})

const tagsList = _.get(tagsRaw, 'repository.refs.nodes', [])
Expand Down Expand Up @@ -53028,9 +53041,9 @@ async function main () {

if (!latestTag) {
if (prefix) {
return core.setFailed(`None of the ${maxTagsToFetchSafe} latest tags are valid semver or match the specified 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 ${maxTagsToFetchSafe} latest tags are valid semver!` : 'Latest tag is invalid (does not conform to semver)!')
return core.setFailed(skipInvalidTags ? `None of the ${fetchLimit} latest tags are valid semver!` : 'Latest tag is invalid (does not conform to semver)!')
}
}

Expand Down
28 changes: 20 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async function main () {
const additionalCommits = core.getInput('additionalCommits').split('\n').map(l => l.trim()).filter(l => l !== '')
const fromTag = core.getInput('fromTag')
const maxTagsToFetch = _.toSafeInteger(core.getInput('maxTagsToFetch') || 10)
const maxTagsToFetchSafe = maxTagsToFetch < 1 || maxTagsToFetch > 100 ? 10 : maxTagsToFetch
const fetchLimit = (maxTagsToFetch < 1 || maxTagsToFetch > 100) ? 10 : maxTagsToFetch

const bumpTypes = {
major: core.getInput('majorList').split(',').map(p => p.trim()).filter(p => p),
Expand All @@ -42,9 +42,20 @@ async function main () {
// GET LATEST + PREVIOUS TAGS

const tagsRaw = await gh.graphql(`
query lastTags ($owner: String!, $repo: String!, $first: Int) {
repository (owner: $owner, name: $repo) {
refs(first: $first, refPrefix: "refs/tags/", orderBy: { field: TAG_COMMIT_DATE, direction: DESC }) {
query lastTags (
$owner: String!
$repo: String!
$fetchLimit: Int
) {
repository (
owner: $owner
name: $repo
) {
refs(
first: $fetchLimit
refPrefix: "refs/tags/"
orderBy: { field: TAG_COMMIT_DATE, direction: DESC }
) {
nodes {
name
target {
Expand All @@ -54,10 +65,11 @@ async function main () {
}
}
}
`, {
`,
{
owner,
repo,
first: maxTagsToFetchSafe
fetchLimit
})

const tagsList = _.get(tagsRaw, 'repository.refs.nodes', [])
Expand Down Expand Up @@ -85,9 +97,9 @@ async function main () {

if (!latestTag) {
if (prefix) {
return core.setFailed(`None of the ${maxTagsToFetchSafe} latest tags are valid semver or match the specified 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 ${maxTagsToFetchSafe} latest tags are valid semver!` : 'Latest tag is invalid (does not conform to semver)!')
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 4024143

Please # to comment.