Skip to content

Commit b44d692

Browse files
Gise23Gise23
andauthored
#191 add zizmor pre commit configuration (#196)
Co-authored-by: Gise23 <karen.gis234@gmail.com>
1 parent da5d0b5 commit b44d692

5 files changed

Lines changed: 30 additions & 4 deletions

File tree

‎.github/workflows/check-pr-template.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ on:
44
pull_request:
55
types: [opened, edited, reopened, synchronize]
66

7+
permissions: {}
8+
79
jobs:
810
check-pr-template:
911
name: Check PR template
1012
uses: beeware/.github/.github/workflows/pr-checklist.yml@main
13+
permissions:
14+
contents: read

‎.github/workflows/ci.yml‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,22 @@ defaults:
1818
env:
1919
FORCE_COLOR: "1"
2020

21+
permissions: {}
22+
2123
jobs:
2224
pre-commit:
2325
name: Pre-commit checks
2426
uses: beeware/.github/.github/workflows/pre-commit-run.yml@main
27+
permissions:
28+
contents: read
2529
with:
2630
pre-commit-source: "pre-commit"
2731

2832
unit-tests:
2933
name: Unit tests
3034
needs: pre-commit
35+
permissions:
36+
contents: read
3137
runs-on: ${{ matrix.runs-on }}
3238
strategy:
3339
fail-fast: false
@@ -112,12 +118,13 @@ jobs:
112118

113119
steps:
114120
- name: Checkout
115-
uses: actions/checkout@v7.0.1
121+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
116122
with:
117123
fetch-depth: 0
124+
persist-credentials: false
118125

119126
- name: Set up Python
120-
uses: actions/setup-python@v7.0.0
127+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
121128
if: matrix.python-version != 'system'
122129
with:
123130
python-version: ${{ matrix.python-version }}
@@ -137,7 +144,7 @@ jobs:
137144
run: briefcase package ${{ matrix.briefcase-target }} --update --adhoc-sign
138145

139146
- name: Upload Logs
140-
uses: actions/upload-artifact@v7.0.1
147+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
141148
if: failure()
142149
with:
143150
name: build-failure-logs-${{ matrix.backend }}-${{ matrix.python-version }}

‎.github/workflows/new-issue.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ on:
77
- reopened
88
- transferred
99

10+
permissions: {}
11+
1012
jobs:
1113
add-to-project:
1214
name: Add issue to BeeWare project
1315
runs-on: ubuntu-latest
1416
steps:
15-
- uses: actions/add-to-project@v2.0.0
17+
- uses: actions/add-to-project@5afcf98fcd03f1c2f92c3c83f58ae24323cc57fd # v2.0.0
1618
with:
1719
project-url: https://github.com/orgs/beeware/projects/1
1820
github-token: ${{ secrets.BRUTUS_PAT_TOKEN }}

‎.github/zizmor.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
rules:
2+
unpinned-uses:
3+
config:
4+
# Allow BeeWare-provided actions to be unpinned. If an attacker is in a
5+
# position to exploit those action, they're probably able to exploit
6+
# repositories directly; and it's significantly easier for our internal
7+
# actions to automatically be the most recent versions.
8+
policies:
9+
beeware/*: ref-pin

‎.pre-commit-config.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ repos:
2727
# remove toml extra once Python 3.10 is no longer supported
2828
additional_dependencies: ['.[toml]']
2929
args: ["--skip=CODE_OF_CONDUCT.md"]
30+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
31+
rev: v1.31.1
32+
hooks:
33+
- id: zizmor

0 commit comments

Comments
 (0)