[Github] Add CodeQL Action to check Github Actions Workflows (#158394)
This should point out obvious security issues with our Github Actions
workflows.
diff --git a/.github/workflows/gha-codeql.yml b/.github/workflows/gha-codeql.yml
new file mode 100644
index 0000000..5a7c79d
--- /dev/null
+++ b/.github/workflows/gha-codeql.yml
@@ -0,0 +1,35 @@
+name: Github Actions CodeQL
+
+permissions:
+ contents: read
+
+on:
+ pull_request:
+ branches:
+ - main
+ schedule:
+ - cron: '30 0 * * *'
+
+concurrency:
+ group: ${{ github.workflow }}
+ cancel-in-progress: true
+
+jobs:
+ codeql:
+ name: 'Github Actions CodeQL'
+ runs-on: ubuntu-24.04
+ permissions:
+ security-events: write
+ steps:
+ - name: Checkout LLVM
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ with:
+ sparse-checkout: |
+ .github/
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3
+ with:
+ languages: actions
+ queries: security-extended
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3