Skip to content

Commit 3721761

Browse files
sanswareclaude
andauthored
chore: add CodeQL workflow and pin actions to commit SHAs (#3)
Adds .github/workflows/codeql.yml running CodeQL static analysis on push, pull_request, and a weekly schedule (Sun 00:00). Targets the javascript-typescript language pack since the spec ships with TS generation tooling. Pins every third-party action invocation (actions/checkout, actions/setup-node, github/codeql-action/*) to a full commit SHA with the corresponding semver tag in a trailing comment. Pinning to SHA closes the supply-chain hole where a compromised or rewritten tag could ship malicious code into CI. Adds a least-privilege top-level `permissions: contents: read` block to the existing validate workflow. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent f8dc295 commit 3721761

2 files changed

Lines changed: 41 additions & 2 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: "0 0 * * 0"
10+
11+
jobs:
12+
analyze:
13+
name: Analyze (${{ matrix.language }})
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 20
16+
permissions:
17+
security-events: write
18+
contents: read
19+
actions: read
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: [javascript-typescript]
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
27+
28+
- name: Initialize CodeQL
29+
uses: github/codeql-action/init@c35d1b164463ee62a100735382aaaa525c5d3496 # codeql-bundle-v2.25.6
30+
with:
31+
languages: ${{ matrix.language }}
32+
33+
- name: Perform CodeQL Analysis
34+
uses: github/codeql-action/analyze@c35d1b164463ee62a100735382aaaa525c5d3496 # codeql-bundle-v2.25.6
35+
with:
36+
category: "/language:${{ matrix.language }}"

.github/workflows/validate.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,20 @@ on:
1111
- "openapi.yaml"
1212
- ".github/workflows/validate.yml"
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
validate:
1619
name: Lint + validate openapi.yaml
1720
runs-on: ubuntu-latest
1821
timeout-minutes: 5
1922
steps:
2023
- name: Checkout
21-
uses: actions/checkout@v4
24+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
2225

2326
- name: Setup Node.js
24-
uses: actions/setup-node@v4
27+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
2528
with:
2629
node-version: "20"
2730

0 commit comments

Comments
 (0)