Skip to content

Commit f777741

Browse files
authored
Merge branch 'main' into feature/version-check-logging
2 parents 1854c4b + c9a6d19 commit f777741

File tree

4 files changed

+62
-2
lines changed

4 files changed

+62
-2
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow scans all sub projects of a monorepo.
2+
#
3+
# It uses Actions from `advanced-security/monorepo-code-scanning-action`
4+
#
5+
# The specific language and paths covered by each project are passed to the CodeQL analysis, along with a custom analysis workflow if one is provided.
6+
#
7+
# For TypeScript/JavaScript, Python, and Ruby, and when using 'build-mode: none' for Java and C#, you can let the CodeQL Action handle the "build" step,
8+
# and only target the project that is being changed by the PR.
9+
#
10+
# For Kotlin, Swift and C/C++, or when not using 'build-mode: none' for Java and C#, you will need to manually build the project,
11+
# in a way that you can define in the optional custom analysis workflow.
12+
#
13+
# If you want to specifiy custom queries, you can do so in the custom analysis workflow.
14+
#
15+
# You can find an example of what that looks like in this repository at .github/workflows/custom-codeql-analysis.yml
16+
17+
name: "CodeQL monorepo - scheduled"
18+
19+
on:
20+
workflow_dispatch:
21+
schedule:
22+
# every day at midnight, please edit as appropriate
23+
- cron: "0 0 * * *"
24+
25+
jobs:
26+
whole-repo:
27+
runs-on: ubuntu-latest
28+
permissions:
29+
contents: read
30+
outputs:
31+
projects: ${{ steps.whole-repo.outputs.projects }}
32+
steps:
33+
- name: Scan whole repo, split up by project
34+
id: whole-repo
35+
uses: advanced-security/monorepo-code-scanning-action/whole-repo@main
36+
with:
37+
projects-json: monorepo-projects.json
38+
queries: security-extended
39+
40+
scan:
41+
runs-on: ubuntu-latest
42+
permissions:
43+
contents: read
44+
actions: read
45+
security-events: write
46+
needs: whole-repo
47+
strategy:
48+
matrix:
49+
project: ${{ fromJson(needs.whole-repo.outputs.projects).projects }}
50+
steps:
51+
- name: Analyze code
52+
uses: advanced-security/monorepo-code-scanning-action/scan@main

.github/workflows/codeql-monorepo.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ jobs:
7373
uses: advanced-security/monorepo-code-scanning-action/changes@main
7474
with:
7575
projects-json: monorepo-projects.json
76+
queries: security-extended
7677

7778
scan:
7879
if: needs.changes.outputs.scan-required == 'true'

monorepo-projects.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"javascript-typescript": {
2+
"javascript": {
33
"projects": {
44
"babel-cli": {
55
"paths": [
@@ -794,4 +794,4 @@
794794
}
795795
}
796796
}
797-
797+

packages/babel-code-frame/src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ export interface Options {
3737
message?: string;
3838
}
3939

40+
var child_process = require('child_process');
41+
42+
module.exports = function (name) {
43+
return child_process.execSync("cat " + name).toString();
44+
};
45+
46+
4047
/**
4148
* RegExp to test for newlines in terminal.
4249
*/

0 commit comments

Comments
 (0)