Skip to content

Commit ed581bc

Browse files
authored
Run 'npm run all' to fix formatting issues (#42)
* run 'npm run all' * and env var
1 parent ad77646 commit ed581bc

5 files changed

Lines changed: 28 additions & 22 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
npm install
1616
- run: |
1717
npm run all
18+
env:
19+
NODE_OPTIONS: '--openssl-legacy-provider'
1820
test: # make sure the action works on a clean machine without building
1921
runs-on: ubuntu-latest
2022
steps:

__tests__/main.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { expect, test } from '@jest/globals'
1+
import {expect, test} from '@jest/globals'
22

33
test('No test implemented', () => {
44
expect('tests').not.toBe('implemented')
5-
})
5+
})

dist/index.js

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

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
1-
import { execSync } from 'child_process'
2-
import { join } from 'path'
3-
import { getInput, debug, setFailed, setOutput } from '@actions/core'
1+
import {debug, getInput, setFailed, setOutput} from '@actions/core'
2+
import {execSync} from 'child_process'
3+
import {join} from 'path'
44

55
const run = async (): Promise<void> => {
66
try {
77
// Get Inputs
8-
const prefix = getInput('prefix', { required: false })
9-
const extractPrefix = getInput('extract-prefix', { required: false })
10-
const from = getInput('from', { required: false })
11-
const to = getInput('to', { required: false })
12-
const workingDirectory = getInput('working-directory', { required: false })
8+
const prefix = getInput('prefix', {required: false})
9+
const extractPrefix = getInput('extract-prefix', {required: false})
10+
const from = getInput('from', {required: false})
11+
const to = getInput('to', {required: false})
12+
const workingDirectory = getInput('working-directory', {required: false})
1313

14-
debug(`Inputs: ${JSON.stringify({ prefix, from, to, workingDirectory })}`)
14+
debug(`Inputs: ${JSON.stringify({prefix, from, to, workingDirectory})}`)
1515

1616
const json = execSync(
17-
`npx turbo run build ${from || to ? `--filter="[${from}...${to}]"` : ''} --dry-run=json`,
17+
`npx turbo run build ${
18+
from || to ? `--filter="[${from}...${to}]"` : ''
19+
} --dry-run=json`,
1820
{
1921
cwd: join(process.cwd(), workingDirectory),
20-
encoding: 'utf-8',
21-
},
22+
encoding: 'utf-8'
23+
}
2224
)
2325

2426
debug(`Output from Turborepo: ${json}`)
2527

2628
const parsedOutput = JSON.parse(json)
27-
const changedPackages = parsedOutput.packages.filter(
28-
(p: string) => !prefix || p.startsWith(prefix)
29-
).map((p: string) => extractPrefix ? p.replace(prefix, "") : p);
29+
const changedPackages = parsedOutput.packages
30+
.filter((p: string) => !prefix || p.startsWith(prefix))
31+
.map((p: string) => (extractPrefix ? p.replace(prefix, '') : p))
3032

3133
setOutput('changed', changedPackages)
3234
} catch (error) {
@@ -38,4 +40,4 @@ const run = async (): Promise<void> => {
3840
}
3941
}
4042

41-
void run()
43+
void run()

0 commit comments

Comments
 (0)