From 269c23c5bbffa946cd54cbfdcd1464db5eaf7b16 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Mon, 27 Mar 2023 01:46:02 -0600 Subject: [PATCH 1/3] github: cleanup codeql action Based on the latest walk-through: https://github.com/github/codeql-action. Gets rid of the warning: Warning: 1 issue was detected with this workflow: git checkout HEAD^2 is no longer necessary. Please remove this step as Code Scanning recommends analyzing the merge commit for best results. Signed-off-by: Felipe Contreras --- .github/workflows/codeql-analysis.yml | 66 +++++---------------------- 1 file changed, 12 insertions(+), 54 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 682cbb6..844f753 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,71 +1,29 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. name: "CodeQL" on: push: branches: [master] pull_request: - # The branches below must be a subset of the branches above branches: [master] schedule: - cron: '0 15 * * 4' jobs: - analyze: - name: Analyze + CodeQL-Build: runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - # Override automatic language detection by changing the below list - # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] - language: ['python'] - # Learn more... - # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + permissions: + # required for all workflows + security-events: write 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 + - name: Checkout repository + uses: actions/checkout@v3 - # 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' }} + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: python - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # 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@v2 - - # ℹī¸ 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@v2 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 From cf66c36a329cc90f033e72e6fc88bb0e929f6764 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Mon, 27 Mar 2023 01:51:42 -0600 Subject: [PATCH 2/3] github: move CodeQL steps into the main action Signed-off-by: Felipe Contreras --- .github/workflows/codeql-analysis.yml | 29 --------------------------- .github/workflows/main.yml | 8 ++++++++ 2 files changed, 8 insertions(+), 29 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 844f753..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: "CodeQL" - -on: - push: - branches: [master] - pull_request: - branches: [master] - schedule: - - cron: '0 15 * * 4' - -jobs: - CodeQL-Build: - runs-on: ubuntu-latest - - permissions: - # required for all workflows - security-events: write - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: python - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dd1b98c..7af0bbf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,3 +19,11 @@ jobs: - name: Run tests run: ./run-tests + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: python + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 From 278cc9966cd7e1a04ada2f1d3605f56f7d721422 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Mon, 27 Mar 2023 01:53:07 -0600 Subject: [PATCH 3/3] github: rename the main action to ci As in: Continuous Integration. Signed-off-by: Felipe Contreras --- .github/workflows/{main.yml => ci.yml} | 2 ++ 1 file changed, 2 insertions(+) rename .github/workflows/{main.yml => ci.yml} (98%) diff --git a/.github/workflows/main.yml b/.github/workflows/ci.yml similarity index 98% rename from .github/workflows/main.yml rename to .github/workflows/ci.yml index 7af0bbf..c6c5116 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,5 @@ +name: CI + on: push: branches: [master]