Skip to content

Commit 8a702e4

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 8a702e4

File tree

4 files changed

+80
-4
lines changed

4 files changed

+80
-4
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,24 @@ 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
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
language: [ 'go', 'javascript-typescript', 'actions' ]
2939
steps:
3040
- name: Checkout (GitHub)
3141
uses: actions/checkout@v5
@@ -37,6 +47,10 @@ jobs:
3747
with:
3848
node-version: ${{ env.NODE_VERSION }}
3949
cache: 'npm'
50+
- name: Initialize CodeQL
51+
uses: github/codeql-action/init@v4
52+
with:
53+
languages: ${{ matrix.language }}
4054
- name: Get Repo Owner
4155
id: get_repo_owner
4256
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV
@@ -46,6 +60,8 @@ jobs:
4660
cacheFrom: ghcr.io/${{ env.REPO_OWNER }}/webstatus-dev-devcontainer-ci-precommit
4761
push: never
4862
runCmd: make precommit
63+
- name: Perform CodeQL Analysis
64+
uses: github/codeql-action/analyze@v4
4965
playwright:
5066
runs-on: ubuntu-latest
5167
steps:

.github/workflows/codeql.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: "CodeQL"
16+
17+
on:
18+
push:
19+
branches: [ main ]
20+
pull_request:
21+
branches: [ main ]
22+
schedule:
23+
- cron: '0 0 * * *'
24+
25+
jobs:
26+
analyze:
27+
name: Analyze
28+
runs-on: ubuntu-latest
29+
30+
permissions:
31+
actions: read
32+
contents: read
33+
security-events: write
34+
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
language: [ 'go', 'javascript-typescript', 'actions' ]
39+
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v5
43+
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v4
46+
with:
47+
languages: ${{ matrix.language }}
48+
49+
- name: Generate code
50+
run: make gen
51+
52+
- name: Autobuild
53+
uses: github/codeql-action/autobuild@v4
54+
55+
- name: Perform CodeQL Analysis
56+
uses: github/codeql-action/analyze@v4

.github/workflows/devcontainer.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ 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:
2226
GO_VERSION: '1.23'
2327
NODE_VERSION: '22'

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)