Skip to content

Commit 39ce3ed

Browse files
committed
feat: add codeql-workflow
1 parent 0dcf6af commit 39ce3ed

File tree

5 files changed

+40
-0
lines changed

5 files changed

+40
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { jsCategoryState } from 'src/states/categories';
2+
import { defaultConfig } from './config/default.config';
3+
4+
export const [getConfig] = jsCategoryState.useConfigState({
5+
default: defaultConfig,
6+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const WORKFLOW_FILENAME = 'codeql.yml';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { addGithubWorkflow } from 'src/utils/github';
2+
import { getConfig } from './codeql-workflow.config';
3+
import { WORKFLOW_FILENAME } from './codeql-workflow.const';
4+
5+
export const codeQlWorkflow = async () => {
6+
const { content } = getConfig();
7+
8+
await addGithubWorkflow(WORKFLOW_FILENAME, content);
9+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { readableMultilineString } from 'src/utils/string';
2+
3+
const content = readableMultilineString`
4+
name: codeql
5+
6+
on: push
7+
8+
jobs:
9+
analyse:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
- name: Initialize CodeQL
15+
uses: github/codeql-action/init@v1
16+
- name: Run CodeQL analyze
17+
uses: github/codeql-action/analyze@v1
18+
`;
19+
20+
export const defaultConfig = {
21+
content,
22+
};

src/categories/js/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { standardVersion } from './standard-version/standard-version.entrypoint'
88
import { releaseWorkflow } from './release-workflow/release-worflow.entrypoint';
99
import { jestEntrypoint } from './jest/jest.entrypoint';
1010
import { testWorkflow } from './test-workflow/test-workflow.entrypoint';
11+
import { codeQlWorkflow } from './codeql-workflow/codeql-workflow.entrypoint';
1112

1213
// order have matter
1314
const options = {
@@ -20,6 +21,7 @@ const options = {
2021
releaseWorkflow,
2122
jest: jestEntrypoint,
2223
testWorkflow,
24+
codeQlWorkflow,
2325
};
2426

2527
export default {

0 commit comments

Comments
 (0)