Skip to content

Commit 3cd2b2b

Browse files
committed
chore(gha): add zizmor, fix issues
1 parent 11cdfdc commit 3cd2b2b

6 files changed

Lines changed: 53 additions & 17 deletions

File tree

‎.github/workflows/cd.yaml‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@ on:
55
branches:
66
- main
77

8+
permissions: {}
9+
810
jobs:
911
check-version:
1012
runs-on: ubuntu-latest
11-
permissions:
12-
pull-requests: write
13+
permissions:
1314
contents: write
1415
steps:
15-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
1617
with:
1718
fetch-depth: 0
19+
persist-credentials: true # Needed to push release tags.
1820
- name: install uv & python
19-
uses: astral-sh/setup-uv@v7
21+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
2022
with:
2123
version: "0.13.7"
2224
python-version: "3.11"

‎.github/workflows/ci.yaml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: CI Workflow
22

33
on: [pull_request, workflow_dispatch]
44

5+
permissions: {}
6+
57
jobs:
68
main:
79
name: CI
@@ -12,9 +14,11 @@ jobs:
1214
runs-on: ${{ matrix.os }}
1315
steps:
1416
- name: Checkout
15-
uses: actions/checkout@v4
17+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
18+
with:
19+
persist-credentials: false
1620
- name: install uv and python
17-
uses: astral-sh/setup-uv@v7
21+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
1822
with:
1923
version: "0.13.7"
2024
python-version: ${{ matrix.python-version }}

‎.github/workflows/dependency-checker.yaml‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,27 @@ on:
55
- cron: "0 0 * * *"
66
workflow_dispatch:
77

8+
permissions: {}
9+
810
jobs:
911
dependency_updater:
1012
name: Dependency-Updater
1113
runs-on: ubuntu-latest
12-
permissions:
13-
pull-requests: write
14+
permissions:
1415
contents: write
1516
steps:
1617
- name: Checkout
17-
uses: actions/checkout@v4
18+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
19+
with:
20+
persist-credentials: true # Needed to push dependency-update branches.
1821
- name: install uv and python
19-
uses: astral-sh/setup-uv@v7
22+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
2023
with:
2124
version: "0.13.7"
2225
python-version: "3.11"
2326
- name: UV Python dependency updater
2427
env:
25-
GH_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
28+
GH_TOKEN: ${{ secrets.RENOVATE_TOKEN }} # Used for PR operations.
2629
run: |
2730
git config --global user.name "SDK Updater Bot"
2831
git config --global user.email "noreply@stackit.de"

‎.github/workflows/labeler.yaml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ on:
77
# run every full hour (to still label PRs from forks)
88
- cron: '0 * * * *'
99

10+
permissions: {}
11+
1012
jobs:
1113
labeler:
1214
permissions:
1315
contents: read
1416
pull-requests: write
15-
issues: write
1617
# don't run on PRs from forks (token has no write permissions)
1718
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
1819
name: "Labeler"
@@ -23,7 +24,7 @@ jobs:
2324
run: |
2425
curl -sSL -o remote-labeler.yml https://raw.githubusercontent.com/stackitcloud/stackit-sdk-go/main/.github/labeler.yml
2526
- name: Labeler action
26-
uses: actions/labeler@v6
27+
uses: actions/labeler@b8dd2d9be0f68b860e7dae5dae7d772984eacd6d # v6.2.0
2728
with:
2829
configuration-path: "remote-labeler.yml"
2930
sync-labels: false

‎.github/workflows/stale.yaml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ env:
1313
DAYS_BEFORE_PR_CLOSE: 14
1414
EXEMPT_PR_LABELS: "ignore-stale"
1515

16-
permissions:
17-
issues: write
18-
pull-requests: write
16+
permissions: {}
1917

2018
jobs:
2119
stale:
2220
name: "Stale"
2321
runs-on: ubuntu-latest
22+
permissions:
23+
pull-requests: write
2424
timeout-minutes: 10
2525
steps:
2626
- name: "Mark old PRs as stale"
27-
uses: actions/stale@v9
27+
uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
2828
with:
2929
repo-token: ${{ secrets.GITHUB_TOKEN }}
3030
stale-pr-message: "This PR was marked as stale after ${{ env.DAYS_BEFORE_PR_STALE }} days of inactivity and will be closed after another ${{ env.DAYS_BEFORE_PR_CLOSE }} days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it."

‎.github/workflows/zizmor.yaml‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: GitHub Actions Security Analysis
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
permissions: {}
10+
11+
jobs:
12+
zizmor:
13+
name: zizmor
14+
runs-on: ubuntu-latest
15+
permissions:
16+
security-events: write # Required to upload SARIF to code scanning.
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
20+
with:
21+
persist-credentials: false
22+
23+
- name: Run zizmor
24+
uses: zizmorcore/zizmor-action@45d7276c9ca790aabd705e31ca99c6185c3e76dd # v0.8.1
25+
with:
26+
version: v1.32.0

0 commit comments

Comments
 (0)