Skip to content

Commit

Permalink
feat: add codeql analysis
Browse files Browse the repository at this point in the history
Runs on all PRs and also weekly
  • Loading branch information
wraithgar committed Feb 2, 2022
1 parent aa3f37e commit 68af6f0
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- main
- latest
schedule:
# "At 02:00 on Monday" https://crontab.guru/#0_1_*_*_1
# "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1
- cron: "0 2 * * 1"

jobs:
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This file is automatically added by @npmcli/template-oss. Do not edit.

name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
# "At 03:00 on Monday" https://crontab.guru/#0_3_*_*_1
- cron: "0 3 * * 1"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
2 changes: 1 addition & 1 deletion lib/content/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- main
- latest
schedule:
# "At 02:00 on Monday" https://crontab.guru/#0_1_*_*_1
# "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1
- cron: "0 2 * * 1"

jobs:
Expand Down
38 changes: 38 additions & 0 deletions lib/content/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This file is automatically added by @npmcli/template-oss. Do not edit.

name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
# "At 03:00 on Monday" https://crontab.guru/#0_3_*_*_1
- cron: "0 3 * * 1"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
1 change: 1 addition & 0 deletions lib/postinstall/copy-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const repoFiles = {
'.github/CODEOWNERS': './CODEOWNERS',
'.github/dependabot.yml': './dependabot.yml',
'.github/workflows/audit.yml': './audit.yml',
'.github/workflows/codeql-analysis.yml': './codeql-analysis.yml',
'.github/workflows/pull-request.yml': './pull-request.yml',
'.github/workflows/release-please.yml': './release-please.yml',
}
Expand Down

0 comments on commit 68af6f0

Please sign in to comment.