Skip to content

Commit c8e3d57

Browse files
authored
fix: update eols in unit tests and readme
1 parent 1745884 commit c8e3d57

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

README.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ This action requires:
2525
## Usage
2626

2727
```yaml
28-
env:
29-
PROJECT_ID: '${{ secrets.GCP_PROJECT }}'
30-
ZONE: 'us-central1-a'
31-
3228
jobs:
3329
job_id:
3430
permissions:
@@ -48,7 +44,7 @@ jobs:
4844
uses: 'google-github-actions/ssh-compute@v0'
4945
with:
5046
instance_name: 'example-instance'
51-
zone: '${{ env.ZONE }}'
47+
zone: 'us-central1-a'
5248
ssh_private_key: '${{ secrets.GCP_SSH_PRIVATE_KEY }}'
5349
command: 'echo Hello world'
5450

@@ -147,9 +143,6 @@ authenticate requests as the service account attached to the instance. **This
147143
only works using a custom runner hosted on GCP.**
148144

149145
```yaml
150-
env:
151-
ZONE: 'us-central1-a'
152-
153146
jobs:
154147
job_id:
155148
steps:
@@ -159,7 +152,7 @@ jobs:
159152
uses: 'google-github-actions/ssh-compute@v0'
160153
with:
161154
instance_name: 'example-instance'
162-
zone: '${{ env.ZONE }}'
155+
zone: 'us-central1-a'
163156
ssh_private_key: '${{ secrets.GCP_SSH_PRIVATE_KEY }}'
164157
command: 'echo Hello world'
165158
```

tests/unit/ssh-compute.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import * as setupGcloud from '@google-github-actions/setup-cloud-sdk';
66
import { expect } from 'chai';
77
import { run, parseFlags } from '../../src/main';
88
import {run as postRun} from '../../src/post';
9+
import {EOL} from 'os';
910

1011
import { promises as fs } from 'fs';
1112

@@ -188,7 +189,7 @@ describe('#ssh-compute', function () {
188189
const call = this.stubs.getExecOutput.getCall(0);
189190
expect(call).to.be;
190191
const args = call.args[1];
191-
expect(args).to.include.members(['bash -c \"echo 1\necho 2\necho 3\"']);
192+
expect(args).to.include.members([`bash -c \"echo 1${EOL}echo 2${EOL}echo 3\"`]);
192193
});
193194

194195
it('sets the correct ssh args if provided', async function () {
@@ -219,7 +220,7 @@ describe('#ssh-compute', function () {
219220
expect(this.stubs.info.withArgs('Skipping ssh keys directory cleanup').callCount).to.eq(1);
220221
expect(this.stubs.rm.callCount).to.eq(0);
221222
});
222-
223+
223224
it('deletes the file if env is set in the run function', async function () {
224225
await run();
225226
await postRun();

0 commit comments

Comments
 (0)