Skip to content

Commit 529731c

Browse files
committed
fix: update publishing workflow to use OIDC
feat: adds compatibility `yargs` `^18.0.0` feat: drop compatibility for node <20
1 parent 42ec32e commit 529731c

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

.github/workflows/node.js.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
node-version: [12, 14, 16, 18, 20, 22]
13+
node-version: [20, 22, 24]
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v5
1616
- name: Use Node.js ${{ matrix.node-version }}
17-
uses: actions/setup-node@v4
17+
uses: actions/setup-node@v6
1818
with:
1919
node-version: ${{ matrix.node-version }}
2020
- run: npm install

.github/workflows/npm-publish.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ on:
77
release:
88
types: [created]
99

10+
permissions:
11+
id-token: write # Required for OIDC
12+
contents: read
13+
1014
jobs:
1115
build:
1216
runs-on: ubuntu-latest
1317
steps:
14-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v5
1519
- uses: actions/setup-node@v4
1620
with:
1721
node-version: latest
@@ -23,12 +27,10 @@ jobs:
2327
needs: build
2428
runs-on: ubuntu-latest
2529
steps:
26-
- uses: actions/checkout@v4
27-
- uses: actions/setup-node@v4
30+
- uses: actions/checkout@v5
31+
- uses: actions/setup-node@v6
2832
with:
2933
node-version: latest
3034
registry-url: https://registry.npmjs.org/
3135
- run: npm install
3236
- run: npm publish
33-
env:
34-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,5 @@ Examples:
3535
yaml-sort --input config.yml Sorts alphabetically and overwrites the file config.yml
3636
yaml-sort --input config.yml --lineWidth 100 --stdout Sorts the file config.yml and output result to STDOUT wrapped to 100 columns
3737
yaml-sort --input config.yml --indent 4 --output sorted.yml Indents with 4 spaces and outputs result to file sorted.yml
38-
yaml-sort --input config.yml --forceQuotes --quotingStyle double Forces double quotes for all scalar values
3938
cat config.yml | yaml-sort Sorts alphabetically from STDIN
4039
```

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "yaml-sort",
3-
"version": "2.1.0",
3+
"version": "3.0.0",
44
"description": "Sort YAML files alphabetically",
55
"main": "yaml-sort.js",
66
"scripts": {
@@ -31,14 +31,14 @@
3131
"homepage": "https://github.com/ddebin/yaml-sort#readme",
3232
"dependencies": {
3333
"js-yaml": "^4.0.0",
34-
"yargs": "^17.0.0"
34+
"yargs": "^18.0.0"
3535
},
3636
"devDependencies": {
3737
"standard": "^17.0.0",
3838
"tape": "^5.6.6",
3939
"tape-spawn": "^1.4.2"
4040
},
4141
"engines": {
42-
"node": ">=12"
42+
"node": ">=20"
4343
}
4444
}

yaml-sort.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
const fs = require('fs')
66
const yaml = require('js-yaml')
77
const yargs = require('yargs')
8+
const { hideBin } = require('yargs/helpers')
89

9-
const argv = yargs
10+
const argv = yargs(hideBin(process.argv))
1011
.usage('Usage: $0 [options]')
1112
.example([
1213
['$0 --input config.yml',
@@ -79,7 +80,7 @@ const argv = yargs
7980
.alias('h', 'help')
8081
.version()
8182
.wrap(null)
82-
.argv
83+
.parse()
8384

8485
let success = true
8586

0 commit comments

Comments
 (0)