Skip to content

Commit

Permalink
Debug release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
shBLOCK committed May 9, 2024
1 parent 0fff6f8 commit 5003b70
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,34 @@ jobs:
debug: true
# noinspection TypeScriptUnresolvedReference
script: |
let tag = context.payload.inputs.tag
if (!tag) {
core.info("Getting latest tag...")
tag = (await github.rest.repos.listTags({
let tag = undefined
let commit = undefined
for await (const tags of github.paginate.iterator(
github.rest.repos.listTags,
{
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 1
})).data[0].name
repo: context.repo.repo
}
)) {
for (const tag_data of tags.data) {
core.info(`Checking tag ${tag_data.name}`)
const commit_data = (await github.rest.repos.getCommit({
owner: context.repo.owner,
repo: context.repo.repo,
ref: tag_data.commit.sha
})).data.commit
if (context.payload.inputs.tag) {
if (tag_data.name == context.payload.input.tag) {
tag = tag_data
commit = commit_data
}
} else {
if (tag == undefined || Date.parse(commit_data.committer.date) > Date.parse(commit.committer.date)) {
tag = tag_date
commit = commit_data
}
}
}
}
core.info(`Using tag: ${tag}`)
core.notice(`Using tag: ${tag}`)
Expand Down

0 comments on commit 5003b70

Please sign in to comment.