Skip to content

Commit 94dce09

Browse files
authored
ci(security): supply chain security (#1615)
1 parent 12a23b4 commit 94dce09

5 files changed

Lines changed: 71 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
run: curl -sL https://firebase.tools/ | sed s/latest/v15.2.1/ | bash
7777
- name: Build site
7878
run: dart run dash_site build
79-
- uses: actions/setup-node@v6
79+
- uses: actions/setup-node@670825a89dc0abd596e7a3abd0f5e3f6e5faf37c
8080
with:
8181
node-version: 24
8282
- name: Translated (docs.flutter.cn)
@@ -121,7 +121,7 @@ jobs:
121121
run: dart pub get
122122
- name: Build site
123123
run: dart run dash_site build --release
124-
- uses: actions/setup-node@v6
124+
- uses: actions/setup-node@670825a89dc0abd596e7a3abd0f5e3f6e5faf37c
125125
with:
126126
node-version: 24
127127
- name: Translated (docs.flutter.cn)
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches:
8+
- main
9+
10+
# Declare default permissions as read only.
11+
permissions: read-all
12+
13+
jobs:
14+
analyze:
15+
name: Analyze
16+
runs-on: ubuntu-latest
17+
if: github.repository == 'cfug/flutter.cn'
18+
permissions:
19+
actions: read
20+
contents: read
21+
security-events: write
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
language: [ 'javascript' ]
27+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
28+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
33+
34+
# Initializes the CodeQL tools for scanning.
35+
- name: Initialize CodeQL
36+
uses: github/codeql-action/init@68bde559dea0fdcac2102bfdf6230c5f70eb485e
37+
with:
38+
languages: ${{ matrix.language }}
39+
# If you wish to specify custom queries, you can do so here or in a config file.
40+
# By default, queries listed here will override any specified in a config file.
41+
# Prefix the list here with "+" to use these queries and those in the config file.
42+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
43+
44+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
45+
# If this step fails, then you should remove it and run the build manually (see below)
46+
- name: Autobuild
47+
uses: github/codeql-action/autobuild@68bde559dea0fdcac2102bfdf6230c5f70eb485e
48+
49+
# ℹ️ Command-line programs to run using the OS shell.
50+
# 📚 https://git.io/JvXDl
51+
52+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
53+
# and modify them (or add more) to build your code if your project
54+
# uses a compiled language
55+
56+
#- run: |
57+
# make bootstrap
58+
# make release
59+
60+
- name: Perform CodeQL Analysis
61+
uses: github/codeql-action/analyze@68bde559dea0fdcac2102bfdf6230c5f70eb485e

.github/workflows/compile_host_redirect_js.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ jobs:
2222
github.repository == 'cfug/flutter.cn' }}
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v6
26-
- uses: actions/setup-node@v6
25+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
26+
- uses: actions/setup-node@670825a89dc0abd596e7a3abd0f5e3f6e5faf37c
2727
with:
2828
node-version: ${{ env.NODE_VERSION }}
2929
- name: Build JS
3030
run: bash ./tool/host-redirect/build.sh
3131
shell: bash
3232
- name: Create Pull Request
33-
uses: peter-evans/create-pull-request@v8
33+
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1
3434
with:
3535
token: ${{ secrets.DOCS_REPO_DEPLOY_TOKEN }}
3636
base: main

.github/workflows/stage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: dart pub get
2929
- name: Build site
3030
run: dart run dash_site build --release
31-
- uses: actions/setup-node@v6
31+
- uses: actions/setup-node@670825a89dc0abd596e7a3abd0f5e3f6e5faf37c
3232
with:
3333
node-version: 24
3434
- name: Translated (docs.flutter.cn)

.github/workflows/translator_bot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ jobs:
88
translator-bot-job:
99
runs-on: ubuntu-latest
1010
name: translator-bot
11+
permissions:
12+
contents: write
13+
issues: write
14+
pull-requests: write
1115
if: |
1216
github.repository == 'cfug/flutter.cn' &&
1317
github.event_name == 'issue_comment' &&

0 commit comments

Comments
 (0)