Skip to content

Commit e14ea46

Browse files
authored
chore: update schema (#40)
1 parent 9033b38 commit e14ea46

File tree

3 files changed

+48
-46
lines changed

3 files changed

+48
-46
lines changed

.github/workflows/schema-change-check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@ jobs:
4343
exit 0
4444
else
4545
echo "File changes detected."
46+
git diff -- ':!pnpm-lock.yaml'
4647
exit 1
4748
fi

src/lib/types/githubActionsWorkflow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ export interface Workflow {
990990
/**
991991
* A boolean specifying whether the secret must be supplied.
992992
*/
993-
required: boolean
993+
required?: boolean
994994
}
995995
}
996996
[k: string]: unknown
Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,78 @@
11
import { Workflow, NormalJob, Step, multilineString } from '../src'
22

33
const checkout = new Step({
4-
name: 'Checkout',
5-
uses: 'actions/checkout@v4',
4+
name: 'Checkout',
5+
uses: 'actions/checkout@v4',
66
})
77

88
const installNode = new Step({
9-
name: 'Install Node',
10-
uses: 'actions/setup-node@v4',
11-
with: { 'node-version': 20 },
9+
name: 'Install Node',
10+
uses: 'actions/setup-node@v4',
11+
with: { 'node-version': 20 },
1212
})
1313

1414
const installGlobalTsx = new Step({
15-
name: 'Install tsx',
16-
run: 'npm install -g tsx',
15+
name: 'Install tsx',
16+
run: 'npm install -g tsx',
1717
})
1818

1919
const installPnpm = new Step({
20-
name: 'Install pnpm',
21-
uses: 'pnpm/action-setup@v4',
22-
with: { version: 8 },
20+
name: 'Install pnpm',
21+
uses: 'pnpm/action-setup@v4',
22+
with: { version: 8 },
2323
})
2424

2525
const installDependencies = new Step({
26-
name: 'Install Dependencies',
27-
run: 'pnpm install --no-frozen-lockfile',
26+
name: 'Install Dependencies',
27+
run: 'pnpm install --no-frozen-lockfile',
2828
})
2929

3030
const generateWorkflowTypes = new Step({
31-
name: 'Generate Workflow Types',
32-
run: 'pnpm generate-workflow-types',
31+
name: 'Generate Workflow Types',
32+
run: 'pnpm generate-workflow-types',
3333
})
3434

3535
const gitDiff = new Step({
36-
name: 'Get git diff',
37-
run: `git diff -- ':!pnpm-lock.yaml'`,
36+
name: 'Get git diff',
37+
run: `git diff -- ':!pnpm-lock.yaml'`,
3838
})
3939

4040
const isGitDiffEmpty = new Step({
41-
name: 'Fail if git diff is not empty',
42-
run: multilineString(
43-
`if test -z "$(git diff --name-only -- ':!pnpm-lock.yaml')"; then`,
44-
` echo "No file changes detected."`,
45-
` exit 0`,
46-
`else`,
47-
` echo "File changes detected."`,
48-
` exit 1`,
49-
`fi`,
50-
),
41+
name: 'Fail if git diff is not empty',
42+
run: multilineString(
43+
`if test -z "$(git diff --name-only -- ':!pnpm-lock.yaml')"; then`,
44+
` echo "No file changes detected."`,
45+
` exit 0`,
46+
`else`,
47+
` echo "File changes detected."`,
48+
` git diff -- ':!pnpm-lock.yaml'`,
49+
` exit 1`,
50+
`fi`,
51+
),
5152
})
5253

5354
const schemaChangeCheck = new NormalJob('SchemaChangeCheck', {
54-
'runs-on': 'ubuntu-latest',
55-
permissions: {
56-
contents: 'write',
57-
},
55+
'runs-on': 'ubuntu-latest',
56+
permissions: {
57+
contents: 'write',
58+
},
5859
}).addSteps([
59-
checkout,
60-
installNode,
61-
installGlobalTsx,
62-
installPnpm,
63-
installDependencies,
64-
generateWorkflowTypes,
65-
gitDiff,
66-
isGitDiffEmpty,
60+
checkout,
61+
installNode,
62+
installGlobalTsx,
63+
installPnpm,
64+
installDependencies,
65+
generateWorkflowTypes,
66+
gitDiff,
67+
isGitDiffEmpty,
6768
])
6869

6970
export const schemaChangeCheckWorkflow = new Workflow('schema-change-check', {
70-
name: 'Schema Change Check',
71-
on: {
72-
pull_request: {
73-
types: ['opened', 'reopened', 'synchronize'],
74-
},
75-
schedule: [{ cron: '0 0 * * *' }],
76-
},
71+
name: 'Schema Change Check',
72+
on: {
73+
pull_request: {
74+
types: ['opened', 'reopened', 'synchronize'],
75+
},
76+
schedule: [{ cron: '0 0 * * *' }],
77+
},
7778
}).addJob(schemaChangeCheck)

0 commit comments

Comments
 (0)