This commit is contained in:
2024-07-31 21:10:01 +02:00
parent 68c487857d
commit a033f712a1
8 changed files with 65 additions and 75 deletions

15
tags/README.md Normal file
View File

@@ -0,0 +1,15 @@
# tags
To install dependencies:
```bash
bun install
```
To run:
```bash
bun run index.js
```
This project was created using `bun init` in bun v1.1.20. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.

BIN
tags/bun.lockb Executable file

Binary file not shown.

View File

@@ -1,4 +1,4 @@
import { info, setOutput } from '@actions/core'
import { info, setOutput, error } from '@actions/core'
import semver from 'semver'
// Fetch the current versions from the download page
@@ -9,8 +9,13 @@ const html = await fetch(URL).then((r) => r.text())
const re = /"\/download\/nginx-(\d+\.){3}tar\.gz"/g
const matches = html.match(re)
if (!matches) {
error(`No versions found at ${URL}`)
process.exit(1)
}
// Clean up the matches to semver format
function clean(match) {
function clean(match: string): string {
return match.replace(/"/g, '').replace('/download/nginx-', '').replace('.tar.gz', '')
}
const versions = matches.map(clean)
@@ -19,7 +24,7 @@ const versions = matches.map(clean)
// Get the two most up to date versions, mainline and stable
const filtered = versions.sort(semver.rcompare).slice(0, 2)
function convert(version, additional = []) {
function convert(version: string, additional: string[] = []) {
return {
version,
// https://github.com/docker/metadata-action#typeraw

View File

@@ -1,8 +1,16 @@
{
"type": "module",
"main": "index.js",
"main": "index.ts",
"dependencies": {
"@actions/core": "^1.10.1",
"semver": "^7.6.3"
},
"devDependencies": {
"@actions/core": "^1.10.0",
"semver": "^7.3.8"
"@tsconfig/strictest": "^2.0.5",
"@types/bun": "latest",
"@types/semver": "^7.5.8"
},
"peerDependencies": {
"typescript": "^5.5.4"
}
}

53
tags/pnpm-lock.yaml generated
View File

@@ -1,53 +0,0 @@
lockfileVersion: 5.4
specifiers:
'@actions/core': ^1.10.0
semver: ^7.3.8
devDependencies:
'@actions/core': 1.10.0
semver: 7.3.8
packages:
/@actions/core/1.10.0:
resolution: {integrity: sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==}
dependencies:
'@actions/http-client': 2.0.1
uuid: 8.3.2
dev: true
/@actions/http-client/2.0.1:
resolution: {integrity: sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==}
dependencies:
tunnel: 0.0.6
dev: true
/lru-cache/6.0.0:
resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
engines: {node: '>=10'}
dependencies:
yallist: 4.0.0
dev: true
/semver/7.3.8:
resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==}
engines: {node: '>=10'}
hasBin: true
dependencies:
lru-cache: 6.0.0
dev: true
/tunnel/0.0.6:
resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==}
engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'}
dev: true
/uuid/8.3.2:
resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==}
hasBin: true
dev: true
/yallist/4.0.0:
resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
dev: true

18
tags/tsconfig.json Normal file
View File

@@ -0,0 +1,18 @@
{
"extends": "@tsconfig/strictest",
"compilerOptions": {
// Enable latest features
"lib": ["ESNext", "DOM"],
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,
// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true
}
}