diff --git a/.github/actions/do-codeql/action.yml b/.github/actions/do-codeql/action.yml new file mode 100644 index 0000000..334fb8c --- /dev/null +++ b/.github/actions/do-codeql/action.yml @@ -0,0 +1,22 @@ +inputs: + language: + description: Language to scan + required: true +description: Do a CodeQL scan +name: CodeQL +runs: + using: composite + steps: + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ inputs.language }} + queries: +security-and-quality + + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{ inputs.language }}" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..0f3b923 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,38 @@ +name: CodeQL + +on: + push: + branches: + - master + pull_request: + branches: + - master + paths: + - ".github/workflows/codeql.yml" + - "**.ts" + - "**.js" + - "**.mts" + - "**.mjs" + - "**.tsx" + - "**.jsx" + - "**.json" + schedule: + - cron: "2 11 * * 0" + +jobs: + analyse: + name: Analyse + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Run + uses: ./.github/actions/do-codeql + with: + language: javascript