From def817633eebeffadf0abfa1c459b5318d913de4 Mon Sep 17 00:00:00 2001 From: Garrett Ladley <92384606+garrettladley@users.noreply.github.com> Date: Thu, 1 Feb 2024 13:58:05 -0500 Subject: [PATCH] Fix: CodeQL Running Too Often (#135) --- .github/workflows/backend_codeql.yml | 45 +++++++++++++ .github/workflows/cli_codeql.yml | 45 +++++++++++++ .github/workflows/codeql.yml | 98 ---------------------------- .github/workflows/mobile_codeql.yml | 42 ++++++++++++ .github/workflows/web_codeql.yml | 42 ++++++++++++ 5 files changed, 174 insertions(+), 98 deletions(-) create mode 100644 .github/workflows/backend_codeql.yml create mode 100644 .github/workflows/cli_codeql.yml delete mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/mobile_codeql.yml create mode 100644 .github/workflows/web_codeql.yml diff --git a/.github/workflows/backend_codeql.yml b/.github/workflows/backend_codeql.yml new file mode 100644 index 000000000..60bba78cc --- /dev/null +++ b/.github/workflows/backend_codeql.yml @@ -0,0 +1,45 @@ +name: Backend CodeQL + +on: + push: + branches: ["main"] + paths: + - "backend/**" + - ".github/workflows/backend_codeql.yml" + pull_request: + branches: ["main"] + paths: + - "backend/**" + - ".github/workflows/backend_codeql.yml" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + security-events: write + strategy: + fail-fast: false + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: "1.21" + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: "go" + queries: security-and-quality + - name: Build + run: | + cd ./backend/ && go build -o backend src/main.go + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:go" diff --git a/.github/workflows/cli_codeql.yml b/.github/workflows/cli_codeql.yml new file mode 100644 index 000000000..caacf0951 --- /dev/null +++ b/.github/workflows/cli_codeql.yml @@ -0,0 +1,45 @@ +name: CLI CodeQL + +on: + push: + branches: ["main"] + paths: + - "cli/**" + - ".github/workflows/cli_codeql.yml" + pull_request: + branches: ["main"] + paths: + - "cli/**" + - ".github/workflows/cli_codeql.yml" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + security-events: write + strategy: + fail-fast: false + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: "1.21" + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: "go" + queries: security-and-quality + - name: Build + run: | + cd ./cli/ && go build -o cli main.go + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:go" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index c8a51aadf..000000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: CodeQL - -on: - push: - branches: ["main"] - paths: - - "backend/**" - - "cli/**" - - "frontend/**" - - ".github/workflows/codeql.yml" - pull_request: - branches: ["main"] - paths: - - "backend/**" - - "cli/**" - - "frontend/**" - - ".github/workflows/codeql.yml" - schedule: - - cron: "0 0 * * 1" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - analyze-js-ts: - name: Analyze JavaScript and TypeScript - runs-on: ubuntu-latest - permissions: - security-events: write - strategy: - fail-fast: false - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: "javascript-typescript" - queries: security-and-quality - - name: Autobuild - uses: github/codeql-action/autobuild@v3 - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:javascript-typescript" - analyze-backend-go: - name: Analyze Backend Go - runs-on: ubuntu-latest - permissions: - security-events: write - strategy: - fail-fast: false - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: "1.21" - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: "go" - queries: security-and-quality - - name: Build - run: | - cd ./backend/ && go build -o backend src/main.go - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:go" - analyze-cli-go: - name: Analyze CLI Go - runs-on: ubuntu-latest - permissions: - security-events: write - strategy: - fail-fast: false - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: "1.21" - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: "go" - queries: security-and-quality - - name: Build - run: | - cd ./cli/ && go build -o cli main.go - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:go" diff --git a/.github/workflows/mobile_codeql.yml b/.github/workflows/mobile_codeql.yml new file mode 100644 index 000000000..c0a12f95f --- /dev/null +++ b/.github/workflows/mobile_codeql.yml @@ -0,0 +1,42 @@ +name: Mobile CodeQL + +on: + push: + branches: ["main"] + paths: + - "frontend/sac-mobile/**" + - ".github/workflows/mobile_codeql.yml" + pull_request: + branches: ["main"] + paths: + - "frontend/sac-mobile/**" + - ".github/workflows/mobile_codeql.yml" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + security-events: write + strategy: + fail-fast: false + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: "javascript-typescript" + queries: security-and-quality + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + with: + working-directory: frontend/sac-mobile + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:javascript-typescript" diff --git a/.github/workflows/web_codeql.yml b/.github/workflows/web_codeql.yml new file mode 100644 index 000000000..b1eee3590 --- /dev/null +++ b/.github/workflows/web_codeql.yml @@ -0,0 +1,42 @@ +name: Web CodeQL + +on: + push: + branches: ["main"] + paths: + - "frontend/sac-web/**" + - ".github/workflows/mweb_codeql.yml" + pull_request: + branches: ["main"] + paths: + - "frontend/sac-web/**" + - ".github/workflows/web_codeql.yml" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + security-events: write + strategy: + fail-fast: false + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: "javascript-typescript" + queries: security-and-quality + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + with: + working-directory: frontend/sac-web + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:javascript-typescript"