Skip to content

Commit

Permalink
Fix: CodeQL Running Too Often (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettladley committed Feb 1, 2024
1 parent fa30a32 commit def8176
Show file tree
Hide file tree
Showing 5 changed files with 174 additions and 98 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/backend_codeql.yml
Original file line number Diff line number Diff line change
@@ -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"
45 changes: 45 additions & 0 deletions .github/workflows/cli_codeql.yml
Original file line number Diff line number Diff line change
@@ -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"
98 changes: 0 additions & 98 deletions .github/workflows/codeql.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/mobile_codeql.yml
Original file line number Diff line number Diff line change
@@ -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"
42 changes: 42 additions & 0 deletions .github/workflows/web_codeql.yml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit def8176

Please sign in to comment.