Skip to content

Commit 4289323

Browse files
committed
Update linters
1 parent a1b035e commit 4289323

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

.github/workflows/cleanup.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,18 @@ jobs:
2323

2424
- uses: 'google-github-actions/setup-gcloud@v2' # ratchet:exclude
2525

26-
- name: Delete services
26+
- name: 'Delete services'
27+
env:
28+
PROJECT_ID: '${{ vars.PROJECT_ID }}'
2729
run: |-
28-
gcloud config set core/project "${{ vars.PROJECT_ID }}"
30+
gcloud config set core/project "${PROJECT_ID}"
2931
gcloud config set functions/region "us-central1"
3032
3133
# List and delete all functions that were deployed 30 minutes ago or
3234
# earlier. The date math here is a little weird, but we're looking for
3335
# deployments "earlier than" 30 minutes ago, so it's less than since
3436
# time increases.
35-
(IFS=$'\n'; for NAME in $(gcloud functions list --format="value(name)" --filter="updateTime < '-pt30m'"); do
37+
(IFS=$'\n'; for NAME in $(gcloud functions list --format='value(name)' --filter='updateTime < "-pt30m"'); do
3638
echo "Deleting ${NAME}..."
37-
gcloud functions delete ${NAME} --quiet
39+
gcloud functions delete "${NAME}" --quiet
3840
done)

.github/workflows/integration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
- uses: 'actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a' # ratchet:actions/setup-node@v4
2929
with:
30-
node-version: '20.x'
30+
node-version-file: 'package.json'
3131

3232
- name: 'npm build'
3333
run: 'npm ci && npm run build'
@@ -57,7 +57,7 @@ jobs:
5757

5858
- uses: 'actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a' # ratchet:actions/setup-node@v4
5959
with:
60-
node-version: '20.x'
60+
node-version-file: 'package.json'
6161

6262
- name: 'npm build'
6363
run: 'npm ci && npm run build'

.github/workflows/unit.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,15 @@ jobs:
3535

3636
- uses: 'actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a' # ratchet:actions/setup-node@v4
3737
with:
38-
node-version: '20.x'
38+
node-version-file: 'package.json'
3939

4040
- name: 'npm build'
4141
run: 'npm ci && npm run build'
4242

43-
- name: 'npm lint'
44-
# There's no need to run the linter for each operating system, since it
45-
# will find the same thing 3x and clog up the PR review.
46-
if: ${{ matrix.os == 'ubuntu-latest' }}
47-
run: 'npm run lint'
48-
4943
- id: 'auth'
5044
uses: 'google-github-actions/auth@v2' # ratchet:exclude
51-
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
45+
if: |-
46+
${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
5247
with:
5348
project_id: '${{ vars.PROJECT_ID }}'
5449
workload_identity_provider: '${{ vars.WIF_PROVIDER_NAME }}'

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.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
"format": "eslint . --fix",
1111
"test": "bash ./bin/runTests.sh"
1212
},
13+
"engines": {
14+
"node": "20.x",
15+
"npm": "10.x"
16+
},
1317
"repository": {
1418
"type": "git",
1519
"url": "https://github.com/google-github-actions/deploy-cloud-functions"

0 commit comments

Comments
 (0)