From 112d8161e16c737be39ebacfc2993c0fa8c2a097 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Fri, 24 Jul 2026 12:23:17 -0700 Subject: [PATCH] Fix code scanning issues: CodeQL setup / workflow permissions - Adds an advanced-setup CodeQL workflow. The Gusto enterprise security config disables code scanning default (automatic) setup org-wide, which has left default CodeQL setup stuck erroring for this repo. An explicit workflow switches to advanced setup, which isn't subject to that policy. - Adds an explicit permissions: contents: read to ci.yml to resolve the actions/missing-workflow-permissions code scanning finding; the shared-config reusable CI workflow only checks out code and posts to a Slack webhook, neither of which needs write access. --- .github/workflows/ci.yml | 3 +++ .github/workflows/codeql.yml | 44 ++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1178ca..611202d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,9 @@ on: - main pull_request: +permissions: + contents: read + jobs: call-workflow-from-shared-config: uses: rubyatscale/shared-config/.github/workflows/ci.yml@main diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..1067dd7 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,44 @@ +name: "CodeQL" + +on: + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: '30 1 * * 0' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + include: + - language: actions + build-mode: none + - language: ruby + build-mode: none + + steps: + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Initialize CodeQL + uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 + with: + category: "/language:${{ matrix.language }}"