From f7e3fa83111017036c52fa958722dcdbca0651f1 Mon Sep 17 00:00:00 2001 From: Justin Hutchings Date: Thu, 4 Jun 2020 16:48:35 -0700 Subject: [PATCH 1/4] Add CodeQL security scanning --- .github/workflows/codeql.yml | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 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 0000000000000..9771ca0f4edde --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,52 @@ +name: "Code scanning - action" + +on: + push: + pull_request: + schedule: + - cron: '0 19 * * 0' + +jobs: + CodeQL-Build: + + # CodeQL runs on ubuntu-latest and windows-latest + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + # Override language selection by uncommenting this and choosing your languages + # with: + # languages: go, javascript, csharp, python, cpp, java + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 From 529fb4749d6605b5296b78462d470b431cd99236 Mon Sep 17 00:00:00 2001 From: Justin Hutchings Date: Thu, 4 Jun 2020 22:48:33 -0700 Subject: [PATCH 2/4] Add CodeQL configuration Limiting analysis to the src folder only --- .github/codeql/codeql-configuration.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .github/codeql/codeql-configuration.yml diff --git a/.github/codeql/codeql-configuration.yml b/.github/codeql/codeql-configuration.yml new file mode 100644 index 0000000000000..69b5d4c36483b --- /dev/null +++ b/.github/codeql/codeql-configuration.yml @@ -0,0 +1,4 @@ +name : CodeQL Configuration + +paths: + - '/src' \ No newline at end of file From fb50cb3b9d169fa6e9d4e792e34cf3ac10e4c548 Mon Sep 17 00:00:00 2001 From: Justin Hutchings Date: Fri, 5 Jun 2020 08:06:10 -0700 Subject: [PATCH 3/4] Add configuration file to codeql action workflow --- .github/workflows/codeql.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 9771ca0f4edde..0eaa4fb427461 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,6 +28,8 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v1 + with: + config-file: ./.github/codeql/codeql-configuration.yml # Override language selection by uncommenting this and choosing your languages # with: # languages: go, javascript, csharp, python, cpp, java From 87c57ed44a342329391c533e19d63afbeb736719 Mon Sep 17 00:00:00 2001 From: Justin Hutchings Date: Fri, 5 Jun 2020 08:10:04 -0700 Subject: [PATCH 4/4] Update codeql-configuration.yml --- .github/codeql/codeql-configuration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/codeql/codeql-configuration.yml b/.github/codeql/codeql-configuration.yml index 69b5d4c36483b..402799f89debe 100644 --- a/.github/codeql/codeql-configuration.yml +++ b/.github/codeql/codeql-configuration.yml @@ -1,4 +1,4 @@ name : CodeQL Configuration paths: - - '/src' \ No newline at end of file + - './src'