Skip to content

Commit fd84dfd

Browse files
authored
ci: zizmor security checks (#6602)
* initial commit * improvements * improve caching * zizmor action * update * delete sidebars.js * fix #6614: `ProgressRing.year_2023` being ignored
1 parent 540b031 commit fd84dfd

10 files changed

Lines changed: 224 additions & 90 deletions

File tree

.github/workflows/ci.yml

Lines changed: 112 additions & 52 deletions
Large diffs are not rendered by default.

.github/workflows/docs.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,32 @@ name: Build docs
33
on:
44
workflow_dispatch:
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
build:
811
name: Build Documentation
912
runs-on: ubuntu-latest
1013
steps:
1114
- name: Checkout repository
12-
uses: actions/checkout@v6
15+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
16+
with:
17+
persist-credentials: false
1318

1419
- name: Setup Node.js
15-
uses: actions/setup-node@v6
20+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
1621
with:
1722
node-version: 24
23+
package-manager-cache: ${{ !startsWith(github.ref, 'refs/tags/') }}
1824

1925
- name: Enable Corepack
2026
run: corepack enable
2127

2228
- name: Setup uv
23-
uses: astral-sh/setup-uv@v8.2.0
29+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
30+
with:
31+
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }}
2432

2533
- name: Build website
2634
run: |

.github/workflows/flet-build-image.yml

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,30 @@ on:
1111
type: boolean
1212
default: true
1313

14-
permissions:
15-
contents: read
16-
packages: write
17-
1814
env:
1915
IMAGE: ghcr.io/${{ github.repository_owner }}/flet-build
2016

2117
jobs:
2218
resolve_version:
2319
name: Resolve Flutter version
2420
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
2523
outputs:
2624
flutter_version: ${{ steps.v.outputs.value }}
2725
steps:
2826
- name: Checkout repository
29-
uses: actions/checkout@v6
27+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
28+
with:
29+
persist-credentials: false
3030

3131
- name: Resolve version
3232
id: v
33+
env:
34+
FLUTTER_VERSION_INPUT: ${{ inputs.flutter_version }}
3335
run: |
34-
if [ -n "${{ inputs.flutter_version }}" ]; then
35-
v="${{ inputs.flutter_version }}"
36+
if [ -n "$FLUTTER_VERSION_INPUT" ]; then
37+
v="$FLUTTER_VERSION_INPUT"
3638
else
3739
v="$(jq -r .flutter .fvmrc)"
3840
fi
@@ -51,11 +53,16 @@ jobs:
5153
- platform: linux/arm64
5254
runner: ubuntu-24.04-arm
5355
runs-on: ${{ matrix.runner }}
56+
permissions:
57+
contents: read
58+
packages: write
5459
env:
5560
FLUTTER_VERSION: ${{ needs.resolve_version.outputs.flutter_version }}
5661
steps:
5762
- name: Checkout repository
58-
uses: actions/checkout@v6
63+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
64+
with:
65+
persist-credentials: false
5966

6067
- name: Compute platform pair
6168
id: pair
@@ -64,18 +71,18 @@ jobs:
6471
echo "value=${p//\//-}" >> "$GITHUB_OUTPUT"
6572
6673
- name: Set up Docker Buildx
67-
uses: docker/setup-buildx-action@v3
74+
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
6875

6976
- name: Log in to GHCR
70-
uses: docker/login-action@v3
77+
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
7178
with:
7279
registry: ghcr.io
7380
username: ${{ github.actor }}
7481
password: ${{ secrets.GITHUB_TOKEN }}
7582

7683
- name: Build & push by digest
7784
id: build
78-
uses: docker/build-push-action@v6
85+
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
7986
with:
8087
context: docker/flet-build
8188
file: docker/flet-build/Dockerfile
@@ -88,13 +95,15 @@ jobs:
8895
provenance: false
8996

9097
- name: Export digest
98+
env:
99+
BUILD_DIGEST: ${{ steps.build.outputs.digest }}
91100
run: |
92101
mkdir -p /tmp/digests
93-
digest="${{ steps.build.outputs.digest }}"
102+
digest="$BUILD_DIGEST"
94103
touch "/tmp/digests/${digest#sha256:}"
95104
96105
- name: Upload digest
97-
uses: actions/upload-artifact@v7
106+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
98107
with:
99108
name: flet-build-digests-${{ steps.pair.outputs.value }}
100109
path: /tmp/digests/*
@@ -107,21 +116,23 @@ jobs:
107116
- resolve_version
108117
- build
109118
runs-on: ubuntu-latest
119+
permissions:
120+
packages: write
110121
env:
111122
FLUTTER_VERSION: ${{ needs.resolve_version.outputs.flutter_version }}
112123
steps:
113124
- name: Download digests
114-
uses: actions/download-artifact@v8
125+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
115126
with:
116127
path: /tmp/digests
117128
pattern: flet-build-digests-*
118129
merge-multiple: true
119130

120131
- name: Set up Docker Buildx
121-
uses: docker/setup-buildx-action@v3
132+
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
122133

123134
- name: Log in to GHCR
124-
uses: docker/login-action@v3
135+
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
125136
with:
126137
registry: ghcr.io
127138
username: ${{ github.actor }}
@@ -139,8 +150,10 @@ jobs:
139150
140151
- name: Create & push manifest
141152
working-directory: /tmp/digests
153+
env:
154+
TAG_FLAGS: ${{ steps.tags.outputs.flags }}
142155
run: |
143-
docker buildx imagetools create ${{ steps.tags.outputs.flags }} \
156+
docker buildx imagetools create $TAG_FLAGS \
144157
$(printf "${IMAGE}@sha256:%s " *)
145158
146159
- name: Inspect image

.github/workflows/flet-build-test-matrix.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
build:
3333
name: Build (${{ matrix.name }})
3434
runs-on: ${{ matrix.runner }}
35+
permissions:
36+
contents: read
3537
strategy:
3638
fail-fast: false
3739
matrix:
@@ -140,13 +142,16 @@ jobs:
140142

141143
steps:
142144
- name: Checkout repository
143-
uses: actions/checkout@v6
145+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
144146
with:
145147
fetch-depth: 0
146148
fetch-tags: true
149+
persist-credentials: false
147150

148151
- name: Setup uv
149-
uses: astral-sh/setup-uv@v8.2.0
152+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
153+
with:
154+
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }}
150155

151156
- name: Patch versions
152157
shell: bash
@@ -165,20 +170,22 @@ jobs:
165170
sudo apt-get clean
166171
167172
- name: Setup Flutter
168-
uses: kuhnroyal/flutter-fvm-config-action/setup@v3
173+
uses: kuhnroyal/flutter-fvm-config-action/setup@c378498f1d1962d33039c3989411093ef8a17b2c # v3.3
169174
with:
170175
path: '.fvmrc'
171-
cache: true
176+
cache: ${{ !startsWith(github.ref, 'refs/tags/') }}
172177

173178
- name: Build app
174179
shell: bash
175180
working-directory: sdk/python/examples/apps/flet_build_test
181+
env:
182+
PYTHON_VERSION: ${{ inputs.python_version }}
176183
run: |
177184
echo "FLET_BUILD_EXTRA_ARGS='${FLET_BUILD_EXTRA_ARGS}'"
178-
uv run ${{ matrix.build_cmd }} --python-version ${{ inputs.python_version }} --yes --verbose --build-number ${{ github.run_number }} $FLET_BUILD_EXTRA_ARGS
185+
uv run ${{ matrix.build_cmd }} --python-version "$PYTHON_VERSION" --yes --verbose --build-number ${{ github.run_number }} $FLET_BUILD_EXTRA_ARGS
179186
180187
- name: Upload Artifact
181-
uses: actions/upload-artifact@v7
188+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
182189
with:
183190
name: ${{ matrix.artifact_name }}-py${{ inputs.python_version }}
184191
path: sdk/python/examples/apps/flet_build_test/${{ matrix.artifact_path }}

.github/workflows/flet-build-test.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ concurrency:
5050
group: ci-${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref_name }}
5151
cancel-in-progress: true
5252

53+
permissions:
54+
contents: read
55+
5356
env:
5457
ROOT: "${{ github.workspace }}"
5558
SDK_PYTHON: "${{ github.workspace }}/sdk/python"
@@ -96,6 +99,8 @@ jobs:
9699
pack:
97100
name: Pack (${{ matrix.name }})
98101
runs-on: ${{ matrix.runner }}
102+
permissions:
103+
contents: read
99104
env:
100105
FLET_DESKTOP_FLAVOR: full
101106
strategy:
@@ -113,19 +118,22 @@ jobs:
113118

114119
steps:
115120
- name: Checkout repository
116-
uses: actions/checkout@v6
121+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
117122
with:
118123
fetch-depth: 0
119124
fetch-tags: true
125+
persist-credentials: false
120126

121127
- name: Setup uv
122-
uses: astral-sh/setup-uv@v8.2.0
128+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
129+
with:
130+
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }}
123131

124132
- name: Setup Flutter
125-
uses: kuhnroyal/flutter-fvm-config-action/setup@v3
133+
uses: kuhnroyal/flutter-fvm-config-action/setup@c378498f1d1962d33039c3989411093ef8a17b2c # v3.3
126134
with:
127135
path: '.fvmrc'
128-
cache: true
136+
cache: ${{ !startsWith(github.ref, 'refs/tags/') }}
129137

130138
- name: Patch versions
131139
shell: bash
@@ -187,7 +195,7 @@ jobs:
187195
uv run --with pyinstaller flet pack src/main.py --yes --name flet-pack-test --distpath dist $FLET_PACK_EXTRA_ARGS
188196
189197
- name: Upload Artifact
190-
uses: actions/upload-artifact@v7
198+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
191199
with:
192200
name: ${{ matrix.name }}-pack-artifact
193201
path: sdk/python/examples/apps/flet_build_test/dist

.github/workflows/macos-integration-tests.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ env:
3737
jobs:
3838
test-macos:
3939
runs-on: macos-26
40+
permissions:
41+
contents: read
4042
strategy:
4143
fail-fast: false
4244
matrix:
@@ -57,16 +59,20 @@ jobs:
5759
name: ${{ matrix.suite }} Integration Tests
5860
steps:
5961
- name: Checkout repository
60-
uses: actions/checkout@v6
62+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
63+
with:
64+
persist-credentials: false
6165

6266
- name: Setup uv
63-
uses: astral-sh/setup-uv@v8.2.0
67+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
68+
with:
69+
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }}
6470

6571
- name: Setup Flutter
66-
uses: kuhnroyal/flutter-fvm-config-action/setup@v3
72+
uses: kuhnroyal/flutter-fvm-config-action/setup@c378498f1d1962d33039c3989411093ef8a17b2c # v3.3
6773
with:
6874
path: '.fvmrc'
69-
cache: true
75+
cache: ${{ !startsWith(github.ref, 'refs/tags/') }}
7076

7177
- name: Show tool versions
7278
run: |
@@ -93,7 +99,7 @@ jobs:
9399

94100
- name: Upload artifact
95101
if: failure()
96-
uses: actions/upload-artifact@v7
102+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
97103
with:
98104
name: integration-test-failures-macos-${{ env.SAFE_SUITE }}
99105
path: sdk/python/packages/flet/integration_tests/${{ matrix.suite }}/**/*_actual.png

.github/workflows/release-pr-changelog.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@ jobs:
1818
changelog_record:
1919
name: Require changelog record
2020
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
2123
steps:
2224
- name: Checkout repository
23-
uses: actions/checkout@v6
25+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2426
with:
2527
fetch-depth: 0
28+
persist-credentials: false
2629

2730
- name: Verify root changelog update
2831
shell: bash

.github/workflows/zizmor.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: zizmor - GitHub Actions Security Analysis
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions: {}
8+
9+
jobs:
10+
zizmor:
11+
name: Run zizmor
12+
runs-on: ubuntu-latest
13+
permissions:
14+
security-events: write
15+
contents: read
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
19+
with:
20+
persist-credentials: false
21+
22+
- name: Run zizmor
23+
uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6
24+
with:
25+
# Fork PRs get a read-only token (no security-events: write), so the
26+
# SARIF upload would fail. Skip it for forks — they still get inline
27+
# annotations; pushes and same-repo PRs upload to code scanning.
28+
advanced-security: ${{ github.event.pull_request.head.repo.fork != true }}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
* Specify `handler` signatures in `subscribe` and `subscribe_topic` methods of `PubSubClient` for better type checking ([#6549](https://github.com/flet-dev/flet/pull/6564)) by @Iaw4tch
4747
* Fix `FilePicker.pick_files()` on web for slow network shares or slow machines: pass `cancel_upload_on_window_blur=False` to prevent valid file selections from being reported as cancelled when the browser window loses focus during file picking ([#771](https://github.com/flet-dev/flet/issues/771), [#6573](https://github.com/flet-dev/flet/pull/6573)) by @ndonkoHenri.
4848
* Support `PagePlatform.ANDROID_TV` in `Page.get_device_info()` retrieval ([#6604](https://github.com/flet-dev/flet/pull/6604)) by @bl1nch.
49+
* Fix `ProgressRing.year_2023` being ignored, so the control correctly switches between the latest and 2023 Material Design appearances ([#6614](https://github.com/flet-dev/flet/issues/6614)) by @ndonkoHenri.
4950

5051
### Documentation
5152

packages/flet/lib/src/controls/progress_ring.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ProgressRingControl extends StatelessWidget {
3333
padding: control.getPadding("padding"),
3434
// ignore: deprecated_member_use
3535
year2023: control.getBool(
36-
"year2023"), // todo: deprecated and to be removed in future versions
36+
"year_2023"), // todo: deprecated and to be removed in future versions
3737
);
3838
return LayoutControl(control: control, child: indicator);
3939
}

0 commit comments

Comments
 (0)