Skip to content

Commit 58131ff

Browse files
authored
ci: use zizmor and remediate findings (#94)
1 parent e6778db commit 58131ff

4 files changed

Lines changed: 61 additions & 16 deletions

File tree

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ updates:
1111
- "*" # Group all Actions updates into a single larger pull request
1212
schedule:
1313
interval: weekly
14+
cooldown:
15+
default-days: 7

.github/workflows/ci.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@ name: Partition Manager CI
22

33
on: [push, pull_request]
44

5+
permissions: {}
6+
57
jobs:
68

79
lint:
810
runs-on: ubuntu-latest
911

1012
steps:
11-
- uses: actions/checkout@v6
13+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
14+
with:
15+
persist-credentials: false
1216
- name: Set up Python 3.9
13-
uses: actions/setup-python@v6
17+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
1418
with:
1519
python-version: 3.9
1620

@@ -43,9 +47,11 @@ jobs:
4347
runs-on: ubuntu-latest
4448

4549
steps:
46-
- uses: actions/checkout@v6
50+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
51+
with:
52+
persist-credentials: false
4753
- name: Set up Python 3.9
48-
uses: actions/setup-python@v6
54+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
4955
with:
5056
python-version: 3.9
5157
- name: Install Partition Manager

.github/workflows/release.yaml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
steps:
2121
- name: Setup python
22-
uses: actions/setup-python@v6
22+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2323
with:
2424
python-version: '3.x'
2525
architecture: 'x64'
@@ -31,26 +31,27 @@ jobs:
3131
pip3 install build
3232
3333
- name: Checkout
34-
uses: actions/checkout@v6
34+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3535
with:
3636
fetch-depth: 0
37+
persist-credentials: false
3738

3839
- name: Get version from git tag
3940
id: get_version
40-
uses: battila7/get-version-action@v2
41+
uses: battila7/get-version-action@d97fbc34ceb64d1f5d95f4dfd6dce33521ccccf5 # v2.3.0
4142

4243
- name: Build partition-manager
4344
run: |
4445
python3 -m build
4546
sha256sum dist/*.whl dist/*.tar.gz >dist/sha256sums
4647
4748
- name: "Publish release"
48-
uses: "marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0"
49-
with:
50-
repo_token: "${{ secrets.GITHUB_TOKEN }}"
51-
automatic_release_tag: "${{ steps.get_version.outputs.version }}"
52-
title: "partition-manager ${{ steps.get_version.outputs.version }}"
53-
files: |
54-
dist/sha256sums
55-
dist/*.whl
56-
dist/*.tar.gz
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
VERSION: ${{ steps.get_version.outputs.version }}
52+
run: |
53+
gh release create "$VERSION" \
54+
--target "$GITHUB_SHA" \
55+
--title "partition-manager $VERSION" \
56+
--generate-notes \
57+
dist/sha256sums dist/*.whl dist/*.tar.gz

.github/workflows/zizmor.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Lint GitHub Actions
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release-branch-*
8+
pull_request:
9+
branches:
10+
- '**'
11+
workflow_dispatch:
12+
13+
permissions: {}
14+
15+
jobs:
16+
zizmor:
17+
runs-on: ubuntu-24.04
18+
19+
env:
20+
ZIZMOR_IMAGE: ghcr.io/zizmorcore/zizmor:1.25.2@sha256:14ea7f5cc7c67933394a35b5a38a277397818d232602635edb2010b313afb110
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25+
with:
26+
persist-credentials: false
27+
28+
- name: Run zizmor
29+
env:
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
run: |
32+
docker run \
33+
--volume "${GITHUB_WORKSPACE}:/src:ro" \
34+
--workdir "/src" \
35+
--env "GH_TOKEN" \
36+
"$ZIZMOR_IMAGE" -- /src

0 commit comments

Comments
 (0)