Skip to content

Commit d0685f5

Browse files
committed
Update linters
1 parent 38f4124 commit d0685f5

File tree

6 files changed

+59
-55
lines changed

6 files changed

+59
-55
lines changed

.github/workflows/unit.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,10 @@ 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

39-
- name: 'npm lint'
40-
# There's no need to run the linter for each operating system, since it
41-
# will find the same thing 3x and clog up the PR review.
42-
if: ${{ matrix.os == 'ubuntu-latest' }}
43-
run: 'npm run lint'
44-
4539
- name: 'npm test'
4640
run: 'npm run test'

action.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
name: SSH to Google Cloud Platform compute instances
16-
author: Google LLC
15+
name: 'SSH to Google Cloud Platform compute instances'
16+
author: 'Google LLC'
1717
description: |-
18-
Use this action to connect to Google Cloud Platform instances via ssh and execute user's commands.
18+
Use this action to connect to Google Cloud Platform instances via ssh and
19+
execute user's commands.
1920
2021
inputs:
2122
instance_name:
@@ -71,7 +72,8 @@ inputs:
7172
required: false
7273

7374
project_id:
74-
description: The GCP project ID. Overrides project ID set by credentials.
75+
description: |-
76+
The GCP project ID. Overrides project ID set by credentials.
7577
required: false
7678

7779
flags:
@@ -97,9 +99,11 @@ inputs:
9799

98100
outputs:
99101
stdout:
100-
description: Stdout from ssh command.
102+
description: |-
103+
Stdout from ssh command.
101104
stderr:
102-
description: Stderr from ssh command.
105+
description: |-
106+
Stderr from ssh command.
103107
104108
branding:
105109
icon: 'terminal'

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
@@ -9,6 +9,10 @@
99
"format": "eslint . --fix",
1010
"test": "bash ./bin/runTests.sh"
1111
},
12+
"engines": {
13+
"node": "20.x",
14+
"npm": "10.x"
15+
},
1216
"repository": {
1317
"type": "git",
1418
"url": "https://github.com/google-github-actions/ssh-compute.git"

workflow-examples/ssh-command-example.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,27 @@ jobs:
2929
id-token: 'write'
3030

3131
steps:
32-
- name: 'Checkout'
33-
uses: 'actions/checkout@v3'
32+
- name: 'Checkout'
33+
uses: 'actions/checkout@v3'
3434

35-
# Configure Workload Identity Federation and generate an access token.
36-
- id: 'auth'
37-
name: 'Authenticate to Google Cloud'
38-
uses: 'google-github-actions/auth@v2'
39-
with:
40-
workload_identity_provider: '${{ vars.WIF_PROVIDER_NAME }}'
41-
service_account: '${{ vars.SERVICE_ACCOUNT_EMAIL }}'
35+
# Configure Workload Identity Federation and generate an access token.
36+
- id: 'auth'
37+
name: 'Authenticate to Google Cloud'
38+
uses: 'google-github-actions/auth@v2'
39+
with:
40+
workload_identity_provider: '${{ vars.WIF_PROVIDER_NAME }}'
41+
service_account: '${{ vars.SERVICE_ACCOUNT_EMAIL }}'
4242

43-
- name: 'SSH to GCP instance'
44-
id: 'ssh'
45-
uses: 'google-github-actions/ssh-compute@v1'
46-
with:
47-
instance_name: 'instance-name'
48-
zone: '${{ env.ZONE }}'
49-
ssh_private_key: '${{ secrets.VM_PRIVATE_KEY }}'
50-
command: 'echo Hello world'
43+
- name: 'SSH to GCP instance'
44+
id: 'ssh'
45+
uses: 'google-github-actions/ssh-compute@v1'
46+
with:
47+
instance_name: 'instance-name'
48+
zone: '${{ env.ZONE }}'
49+
ssh_private_key: '${{ secrets.VM_PRIVATE_KEY }}'
50+
command: 'echo Hello world'
5151

52-
- name: 'Show Output'
53-
run: |-
54-
echo '${{ steps.ssh.outputs.stdout }}'
55-
echo '${{ steps.ssh.outputs.stderr }}'
52+
- name: 'Show Output'
53+
run: |-
54+
echo '${{ steps.ssh.outputs.stdout }}'
55+
echo '${{ steps.ssh.outputs.stderr }}'

workflow-examples/ssh-script-example.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,27 @@ jobs:
2929
id-token: 'write'
3030

3131
steps:
32-
- name: 'Checkout'
33-
uses: 'actions/checkout@v3'
32+
- name: 'Checkout'
33+
uses: 'actions/checkout@v3'
3434

35-
# Configure Workload Identity Federation and generate an access token.
36-
- id: 'auth'
37-
name: 'Authenticate to Google Cloud'
38-
uses: 'google-github-actions/auth@v2'
39-
with:
40-
workload_identity_provider: '${{ vars.WIF_PROVIDER_NAME }}'
41-
service_account: '${{ vars.SERVICE_ACCOUNT_EMAIL }}'
35+
# Configure Workload Identity Federation and generate an access token.
36+
- id: 'auth'
37+
name: 'Authenticate to Google Cloud'
38+
uses: 'google-github-actions/auth@v2'
39+
with:
40+
workload_identity_provider: '${{ vars.WIF_PROVIDER_NAME }}'
41+
service_account: '${{ vars.SERVICE_ACCOUNT_EMAIL }}'
4242

43-
- name: 'SSH to GCP instance'
44-
id: 'ssh'
45-
uses: 'google-github-actions/ssh-compute@v1'
46-
with:
47-
instance_name: 'instance-name'
48-
zone: '${{ env.ZONE }}'
49-
ssh_private_key: '${{ secrets.VM_PRIVATE_KEY }}'
50-
script: '${{ github.workspace }}/script-examples/script.sh'
43+
- name: 'SSH to GCP instance'
44+
id: 'ssh'
45+
uses: 'google-github-actions/ssh-compute@v1'
46+
with:
47+
instance_name: 'instance-name'
48+
zone: '${{ env.ZONE }}'
49+
ssh_private_key: '${{ secrets.VM_PRIVATE_KEY }}'
50+
script: '${{ github.workspace }}/script-examples/script.sh'
5151

52-
- name: 'Show Output'
53-
run: |-
54-
echo '${{ steps.ssh.outputs.stdout }}'
55-
echo '${{ steps.ssh.outputs.stderr }}'
52+
- name: 'Show Output'
53+
run: |-
54+
echo '${{ steps.ssh.outputs.stdout }}'
55+
echo '${{ steps.ssh.outputs.stderr }}'

0 commit comments

Comments
 (0)