Skip to content

Commit 5568437

Browse files
committed
Add linters
1 parent 2009cb4 commit 5568437

5 files changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
- uses: 'actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a' # ratchet:actions/setup-node@v4
2626
with:
27-
node-version: '20.x'
27+
node-version-file: 'package.json'
2828
registry-url: 'https://wombat-dressing-room.appspot.com/'
2929

3030
- env:

.github/workflows/test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,16 @@ jobs:
3131

3232
- uses: 'actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a' # ratchet:actions/setup-node@v4
3333
with:
34-
node-version: '20.x'
34+
node-version-file: 'package.json'
3535

3636
- name: 'npm build'
3737
run: 'npm ci && npm run build'
3838

3939
- name: 'npm lint'
4040
# There's no need to run the linter for each operating system, since it
4141
# will find the same thing 3x and clog up the PR review.
42-
if: ${{ matrix.os == 'ubuntu-latest' }}
42+
if: |-
43+
${{ matrix.os == 'ubuntu-latest' }}
4344
run: 'npm run lint'
4445

4546
- name: 'npm test'

bin/runTests.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ set -eEuo pipefail
1616
FILES="$(node -e "process.stdout.write(require('node:fs').readdirSync('./', { recursive: true }).filter((e) => {return e.endsWith('.test.ts') && !e.startsWith('node_modules');}).sort().join(' '));")"
1717

1818
set -x
19+
20+
# shellcheck disable=SC2086
1921
exec node --require ts-node/register --test-reporter spec --test ${FILES}

package-lock.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
"description": "Helpers and utilities that are shared among Google GitHub Actions",
55
"author": "Google LLC",
66
"license": "Apache-2.0",
7+
"engines": {
8+
"node": ">= 20.x",
9+
"npm": ">= 11.x"
10+
},
711
"scripts": {
812
"build": "rm -rf dist/ && ncc build --source-map --no-source-map-register src/index.ts",
913
"lint": "eslint .",

0 commit comments

Comments
 (0)