Skip to content

Commit 7b1518e

Browse files
rootroot
authored andcommitted
ci(supply-chain): add dependency and code scanning baselines
Add Dependabot and CodeQL coverage, and harden the existing CI workflow with pinned actions, permissions, and timeouts.
1 parent a1bf426 commit 7b1518e

3 files changed

Lines changed: 69 additions & 4 deletions

File tree

.github/dependabot.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
groups:
8+
all:
9+
patterns:
10+
- "*"
11+
- package-ecosystem: "npm"
12+
directory: "/chrome-bridge"
13+
schedule:
14+
interval: "weekly"
15+
- package-ecosystem: "pip"
16+
directory: "/api-server"
17+
schedule:
18+
interval: "weekly"
19+
- package-ecosystem: "pip"
20+
directory: "/python-mediapipe"
21+
schedule:
22+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@ on:
66
pull_request:
77
branches: ["**"]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
api-server:
1114
name: api-server (Python)
1215
runs-on: ubuntu-latest
16+
timeout-minutes: 15
1317
defaults:
1418
run:
1519
working-directory: api-server
1620

1721
steps:
18-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
1923

20-
- uses: actions/setup-python@v5
24+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
2125
with:
2226
python-version: "3.12"
2327
cache: pip
@@ -45,14 +49,15 @@ jobs:
4549
chrome-bridge:
4650
name: chrome-bridge (Node.js)
4751
runs-on: ubuntu-latest
52+
timeout-minutes: 15
4853
defaults:
4954
run:
5055
working-directory: chrome-bridge
5156

5257
steps:
53-
- uses: actions/checkout@v4
58+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
5459

55-
- uses: actions/setup-node@v4
60+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
5661
with:
5762
node-version: "22"
5863
cache: npm

.github/workflows/codeql.yml

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

0 commit comments

Comments
 (0)