Skip to content

Commit a053276

Browse files
committed
fix: address security vulnerabilities and improve CI
This commit addresses multiple security vulnerabilities and improves the CI workflow. - Security: - Patches a high-severity vulnerability in the tar-fs npm package by updating dependencies. See: https://github.com/GoogleChrome/webstatus.dev/security/dependabot - Adds explicit permissions to GitHub Actions workflows to mitigate potential security risks. See: https://github.com/GoogleChrome/webstatus.dev/security/code-scanning - CI/CodeQL: - Integrates CodeQL analysis directly into the main build job in the ci.yml workflow for Go, JavaScript/TypeScript, and Actions. - The CodeQL analysis now leverages the devcontainer, ensuring a consistent and accurate build environment. - This resolves previous CodeQL failures by ensuring generated code is available for analysis. See: https://github.com/GoogleChrome/webstatus.dev/security/code-scanning/tools/CodeQL/status/configurations/automatic/50b81ab7aa14a07a66df525212035d409a54427fca55f64790c4765d94a09359 Generated with Gemini.
1 parent 7342afa commit a053276

3 files changed

Lines changed: 23 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,20 @@ on: # trigger builds for 1) PRs, 2) merges into main from merge_queue, and 3) ma
1818
merge_group:
1919
workflow_dispatch:
2020

21+
permissions:
22+
contents: read
23+
2124
env:
22-
GO_VERSION: '1.23'
25+
GO_VERSION: '1.25'
2326
NODE_VERSION: '22'
2427
GO_CACHE_DEPENDENCY_PATH: '**/*.sum'
2528

2629
jobs:
2730
build:
2831
runs-on: ubuntu-latest
32+
permissions:
33+
contents: read
34+
security-events: write
2935
steps:
3036
- name: Checkout (GitHub)
3137
uses: actions/checkout@v5
@@ -37,15 +43,21 @@ jobs:
3743
with:
3844
node-version: ${{ env.NODE_VERSION }}
3945
cache: 'npm'
46+
- name: Initialize CodeQL
47+
uses: github/codeql-action/init@v4
48+
with:
49+
languages: go, javascript-typescript, actions
4050
- name: Get Repo Owner
4151
id: get_repo_owner
4252
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV
43-
- name: Run precommit target for CI
53+
- name: Run build and precommit for CI
4454
uses: devcontainers/ci@v0.3
4555
with:
4656
cacheFrom: ghcr.io/${{ env.REPO_OWNER }}/webstatus-dev-devcontainer-ci-precommit
4757
push: never
48-
runCmd: make precommit
58+
runCmd: make gen && make precommit
59+
- name: Perform CodeQL Analysis
60+
uses: github/codeql-action/analyze@v4
4961
playwright:
5062
runs-on: ubuntu-latest
5163
steps:

.github/workflows/devcontainer.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@ on:
1818
schedule:
1919
- cron: '0 0 * * 2' # Runs every Tuesday at midnight UTC
2020

21+
permissions:
22+
contents: read
23+
packages: write
24+
2125
env:
22-
GO_VERSION: '1.23'
26+
GO_VERSION: '1.25'
2327
NODE_VERSION: '22'
2428
GO_CACHE_DEPENDENCY_PATH: '**/*.sum'
2529

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)