Skip to content

Commit d6cfcf9

Browse files
authored
Merge pull request #1432 from yedayak/zizmor-ghactions
Analyze github workflows with zizmor
2 parents a186fab + f86921c commit d6cfcf9

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ on:
66
branches:
77
- main
88

9+
permissions: {}
10+
911
jobs:
1012
pre-commit:
1113
runs-on: ubuntu-latest
1214
steps:
1315
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1416
with: # for gitlint
17+
persist-credentials: false
1518
ref: ${{ github.event.pull_request.head.sha }}
1619
fetch-depth: 0
1720
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
@@ -39,6 +42,8 @@ jobs:
3942
4043
distcheck:
4144
runs-on: ubuntu-latest
45+
permissions:
46+
contents: write # TODO: This is needed for release, maybe split the release steps to a different job?
4247
strategy:
4348
matrix:
4449
include:
@@ -53,6 +58,8 @@ jobs:
5358
fail-fast: false
5459
steps:
5560
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
61+
with:
62+
persist-credentials: false
5663
- uses: googleapis/release-please-action@5792afc6b46e9bb55deda9eda973a18c226bc3fc # v4.1.5
5764
with:
5865
config-file: .github/release-please-config.json
@@ -89,8 +96,9 @@ jobs:
8996
- name: Upload release assets
9097
run: |
9198
set -x
92-
gh release upload ${{steps.release.outputs.tag_name}} \
99+
gh release upload ${RELEASE_PLEASE_TAG_NAME} \
93100
bash-completion-$(cat version.txt).tar.xz sha256sums.txt
94101
env:
95102
GH_TOKEN: ${{github.token}}
103+
RELEASE_PLEASE_TAG_NAME: ${{steps.release.outputs.tag_name}}
96104
if: steps.release.outputs.release_created

.github/workflows/update-docker-images.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ on:
1515
- test/docker/*/install-packages.sh
1616
workflow_dispatch:
1717

18+
permissions: {}
19+
1820
jobs:
1921
update-test-image:
2022
runs-on: ubuntu-latest
@@ -27,8 +29,12 @@ jobs:
2729
- dist: debian10
2830
- dist: fedoradev
2931
- dist: ubuntu14
32+
permissions:
33+
packages: write # Get token that can write to ghcr.io
3034
steps:
3135
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
36+
with:
37+
persist-credentials: false
3238
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
3339
with:
3440
registry: ghcr.io

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,9 @@ repos:
102102
hooks:
103103
- id: typos
104104
exclude: ^(CHANGELOG\.md|test/(test-cmd-list\.txt|fixtures/.+))$
105+
106+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
107+
rev: v1.13.0
108+
hooks:
109+
- id: zizmor
110+
files: '^.github/.*$'

0 commit comments

Comments
 (0)