Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
paths:
.github/workflows/**/*.{yml,yaml}:
ignore:
- 'invalid runner name "node24" at runs.using'
6 changes: 3 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
pull-requests: write

jobs:
lint:
name: "Lint"
runs-on: ubuntu-latest
timeout-minutes: 5

permissions:
pull-requests: write

steps:
- name: "Checkout"
uses: actions/checkout@v5
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pull.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
name: "Pull"
runs-on: ubuntu-latest
timeout-minutes: 5

permissions:
pull-requests: write

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
name: "Release"
runs-on: ubuntu-latest
timeout-minutes: 5

permissions:
contents: write

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
name: "Tags"
runs-on: ubuntu-latest
timeout-minutes: 5

permissions:
contents: write

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ on:
#push:
# branches: ["**"]
# paths:
# - ".github/workflows/test.yaml"
# - "dist/**"
# - "src/**"
# - "package*.json"
# - "requirements*.txt"
# - ".github/workflows/test.yaml"
# - "action.yml"

concurrency:
Expand All @@ -23,6 +23,7 @@ jobs:
name: "Test"
runs-on: ubuntu-latest
timeout-minutes: 5

permissions:
contents: write

Expand All @@ -36,6 +37,11 @@ jobs:
run: |
cat "${GITHUB_EVENT_PATH}"

- name: "INOP"
run: |
echo "This test must be updated for this action"
exit 1

- name: "Test Local Action"
id: test
uses: ./
Expand Down
7 changes: 1 addition & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,22 @@ branding:
inputs:
semver:
description: "New Version: See semver.inc"
required: false
default: "prerelease"
identifier:
description: "Prerelease Tag to Append"
required: false
default: "beta"
#patch:
# description: "New Version: major, minor, micro, patch"
# required: false
# default: ""
prerelease:
description: "Mark release as prerelease"
required: false
default: "true"
summary:
description: "Add Summary to Job"
required: false
default: "true"
token:
description: "GitHub Token"
required: false
default: ${{ github.token }}

outputs:
Expand All @@ -38,5 +33,5 @@ outputs:
description: "Release HTML URL"

runs:
using: "node20"
using: "node24"
main: "dist/index.js"
4 changes: 4 additions & 0 deletions commit-checklist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
{ "value": "Run Build", "fileMask": "*src\\*.js" },
{ "value": "Check main in action.yml", "fileMask": "*action.yml" }
]
43 changes: 35 additions & 8 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7820,6 +7820,7 @@ const isSatisfiable = (comparators, options) => {
// already replaced the hyphen ranges
// turn into a set of JUST comparators.
const parseComparator = (comp, options) => {
comp = comp.replace(re[t.BUILD], '')
debug('comp', comp, options)
comp = replaceCarets(comp, options)
debug('caret', comp)
Expand Down Expand Up @@ -8240,11 +8241,25 @@ class SemVer {
other = new SemVer(other, this.options)
}

return (
compareIdentifiers(this.major, other.major) ||
compareIdentifiers(this.minor, other.minor) ||
compareIdentifiers(this.patch, other.patch)
)
if (this.major < other.major) {
return -1
}
if (this.major > other.major) {
return 1
}
if (this.minor < other.minor) {
return -1
}
if (this.minor > other.minor) {
return 1
}
if (this.patch < other.patch) {
return -1
}
if (this.patch > other.patch) {
return 1
}
return 0
}

comparePre (other) {
Expand Down Expand Up @@ -9145,6 +9160,10 @@ module.exports = debug

const numeric = /^[0-9]+$/
const compareIdentifiers = (a, b) => {
if (typeof a === 'number' && typeof b === 'number') {
return a === b ? 0 : a < b ? -1 : 1
}

const anum = numeric.test(a)
const bnum = numeric.test(b)

Expand Down Expand Up @@ -34622,7 +34641,6 @@ async function processRelease(inputs) {
console.log('previous.draft:', previous?.draft)
console.log('latest.tag_name:', latest?.tag_name)
console.log('previous.tag_name:', previous?.tag_name)
// if (latest.draft && latest.body.includes(script_id)) {
if (latest.draft && latest.author.id === bot_id && latest.body.includes(script_id)) {
core.info(`⛔ Deleting Latest Draft: \u001b[31;1m${latest.tag_name}`)
const response = await octokit.rest.repos.deleteRelease({
Expand All @@ -34638,14 +34656,23 @@ async function processRelease(inputs) {
throw new Error(`Unable to parse ${inputs.semver} from ${latest.tag_name}`)
}

const notes = await octokit.rest.repos.generateReleaseNotes({
...github.context.repo,
tag_name,
previous_tag_name: latest.tag_name,
})
console.log('notes.status:', notes.status)
console.log('notes.data:', notes.data)

core.info(`Creating New Draft: \u001b[33;1m${tag_name}`)
const response = await octokit.rest.repos.createRelease({
...github.context.repo,
tag_name,
draft: true,
prerelease: inputs.prerelease,
generate_release_notes: true,
body: `\n\n\n\n${script_id}`,
generate_release_notes: false,
name: notes.data.name,
body: `\n\n\n${script_id}\n\n${notes.data.body}`,
})
console.log('response.status:', response.status)
return response
Expand Down
55 changes: 29 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"dependencies": {
"@actions/core": "^1.11.1",
"@actions/github": "^6.0.1",
"semver": "^7.7.2"
"semver": "^7.7.3"
},
"devDependencies": {
"@eslint/js": "^9.36.0",
"@eslint/js": "^9.37.0",
"@vercel/ncc": "^0.38.4",
"eslint": "^9.36.0",
"eslint": "^9.37.0",
"prettier": "^3.6.2"
}
}
Loading