From d2ee774149fe6d002485017d32206058856b8dfa Mon Sep 17 00:00:00 2001 From: Devin Kinch <167117452+devink-pantheon@users.noreply.github.com> Date: Fri, 7 Jun 2024 14:25:54 -0700 Subject: [PATCH 1/2] Create CodeQL analysis workflow --- .github/workflows/codeql.yml | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..06e79dc --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,50 @@ +name: "CodeQL" + +on: + push: + branches: ['master'] + pull_request: + # The branches below must be a subset of the branches above + branches: [ '**' ] + +jobs: + analyze: + name: Analyze + runs-on: [ ubuntu-latest ] + permissions: + packages: read + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: ['go'] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Configure git to use token + env: + GH_TOKEN: ${{ secrets.CODEQL_GOLANG_BUILD }} + run: + git config --global url."https://${GH_TOKEN}:x-oauth-basic@github.com/pantheon-systems/".insteadOf "https://github.com/pantheon-systems/" + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + config-file: ./.github/codeql/codeql-config.yml + queries: security-extended + + - name: Autobuild + env: + GOPRIVATE: github.com/pantheon-systems + uses: github/codeql-action/autobuild@v3 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" From 8b0c47df80e304a7fc6fd6d54b3ed8c614f0c05b Mon Sep 17 00:00:00 2001 From: Devin Kinch <167117452+devink-pantheon@users.noreply.github.com> Date: Fri, 7 Jun 2024 14:25:59 -0700 Subject: [PATCH 2/2] Create CodeQL config file --- .github/codeql/codeql-config.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/codeql/codeql-config.yml diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 0000000..e01b1f9 --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1,10 @@ +# Configuration file for CodeQL. + +paths-ignore: + - "devops/**" + - "docs/**" + - "**/tests/**" + - "test/**" + - "scripts/**" + - "**/__tests__/**" + - "**/__mock__/**"