Skip to content

Commit

Permalink
Update action to use node 20
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrohdezma committed Dec 4, 2023
1 parent c8fc610 commit b9606d0
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: '16'
node-version: '20'

- name: Run `npm install`
run: npm install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_auto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: '16'
node-version: '20'

- name: Run `npm install`
run: npm install
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ inputs:
required: false

runs:
using: node16
using: node20
pre: dist/pre.js
main: dist/main.js
post: dist/post.js
16 changes: 3 additions & 13 deletions package-lock.json

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

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
"name": "scala-steward-action",
"description": "A GitHub Action to launch Scala Steward in your repository",
"scripts": {
"tsconfig": "echo '{ \"extends\": \"@tsconfig/recommended/tsconfig.json\" }' > tsconfig.json",
"build": "npm run tsconfig && npm run build-pre && npm run build-main && npm run build-post",
"build-pre": "ncc build --target es2019 src/action/pre.ts && mv dist/index.js dist/pre.js",
"build-main": "ncc build --target es2019 src/action/main.ts && mv dist/index.js dist/main.js",
"build-post": "ncc build --target es2019 src/action/post.ts && mv dist/index.js dist/post.js",
"build": "npm run build-pre && npm run build-main && npm run build-post",
"build-pre": "ncc build src/action/pre.ts && mv dist/index.js dist/pre.js",
"build-main": "ncc build src/action/main.ts && mv dist/index.js dist/main.js",
"build-post": "ncc build src/action/post.ts && mv dist/index.js dist/post.js",
"docs": "ts-node src/utils/docs.ts && markdown-toc-gen update README.md",
"contributors:add": "all-contributors add",
"contributors:generate": "all-contributors generate",
Expand All @@ -15,6 +14,9 @@
"report": "c8 report",
"all": "npm run build && npm test && npm run report"
},
"engines": {
"node": ">=20"
},
"repository": {
"type": "git",
"url": "git+https://github.com/scala-steward-org/scala-steward-action.git"
Expand Down Expand Up @@ -43,7 +45,6 @@
},
"devDependencies": {
"@ava/typescript": "^4.1.0",
"@tsconfig/recommended": "^1.0.3",
"@types/js-yaml": "^4.0.5",
"@types/node": "^20.4.5",
"@vercel/ncc": "^0.36.1",
Expand Down
11 changes: 7 additions & 4 deletions src/utils/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ type ActionYaml = {inputs: Record<string, {description: string; default: string

const actionYaml = yaml.load(fs.readFileSync('action.yml', {encoding: 'utf8'})) as ActionYaml

const inputs = Object.entries(actionYaml.inputs).flatMap(input => ['']
.concat(...input[1].description.trimEnd().split('\n').map(line => ` # ${line}`))
.concat(input[1].default ? [' #', ` # Default: ${input[1].default}`] : [])
.concat(` ${input[0]}: ''`),
const inputs = Object.entries(actionYaml.inputs).flatMap(input =>
[
'',
...input[1].description.trimEnd().split('\n').map(line => ` # ${line}`),
...(input[1].default ? [' #', ` # Default: ${input[1].default}`] : []),
` ${input[0]}: ''`,
],
)

/**
Expand Down

0 comments on commit b9606d0

Please sign in to comment.