Skip to content

chore: add CodeQL analysis and ShellCheck linting workflow #8

chore: add CodeQL analysis and ShellCheck linting workflow

chore: add CodeQL analysis and ShellCheck linting workflow #8

Workflow file for this run

name: CodeQL
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
merge_group:
branches:
- main
- dev
schedule:
- cron: "27 12 * * 4"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
security-events: write
packages: read
actions: read
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: rust
build-mode: none
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Initialize CodeQL
uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-extended
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # v4
with:
category: "/language:${{ matrix.language }}"
shellcheck:
name: Shell Script Lint
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # 2.0.0
with:
scandir: "."
format: gcc
severity: warning
all-checks:
name: CodeQL
needs: [analyze, shellcheck]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
- name: Conclusion
run: |
jq -C <<< '${{ toJson(needs) }}'
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'