Skip to content

Commit 179ccd2

Browse files
[GH-1977] Add zizmor with pre-commit (#2582)
Co-authored-by: Aashish Jha <aashishjha1107@gmail.com>
1 parent e34eea3 commit 179ccd2

14 files changed

Lines changed: 72 additions & 1 deletion

.github/linters/zizmor.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
rules:
19+
unpinned-uses:
20+
config:
21+
policies:
22+
actions/*: any
23+
astral-sh/setup-uv: any
24+
docker/setup-qemu-action: any
25+
github/*: any
26+
pypa/cibuildwheel: any
27+
r-lib/actions/check-r-package: any
28+
r-lib/actions/setup-r: any
29+
r-lib/actions/setup-r-dependencies: any

.github/workflows/codeql.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ jobs:
4141
steps:
4242
- name: Checkout repository
4343
uses: actions/checkout@v6
44+
with:
45+
persist-credentials: false
4446

4547
- name: Initialize CodeQL
4648
uses: github/codeql-action/init@v4

.github/workflows/docker-build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ jobs:
6060
shell: bash
6161
steps:
6262
- uses: actions/checkout@v6
63+
with:
64+
persist-credentials: false
6365
- uses: actions/setup-java@v5
6466
with:
6567
distribution: 'zulu'

.github/workflows/docs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ on:
2626
branches:
2727
- '*'
2828

29+
permissions:
30+
contents: write
31+
2932
env:
3033
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
3134

@@ -40,6 +43,7 @@ jobs:
4043
- uses: actions/checkout@v6
4144
with:
4245
fetch-depth: 0
46+
persist-credentials: false
4347
- name: Set up Java
4448
uses: actions/setup-java@v5
4549
with:

.github/workflows/example.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ jobs:
5959
hadoop: 3.3.4
6060
steps:
6161
- uses: actions/checkout@v6
62+
with:
63+
persist-credentials: false
6264
- uses: actions/setup-java@v5
6365
with:
6466
distribution: 'zulu'

.github/workflows/java.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ jobs:
8686
skipTests: ''
8787
steps:
8888
- uses: actions/checkout@v6
89+
with:
90+
persist-credentials: false
8991
- uses: actions/setup-java@v5
9092
with:
9193
distribution: 'zulu'

.github/workflows/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# https://github.com/actions/labeler
1919
name: Pull Request Labeler
2020
on:
21-
- pull_request_target
21+
- pull_request_target # zizmor: ignore[dangerous-triggers]
2222
jobs:
2323
triage:
2424
permissions:

.github/workflows/pre-commit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
steps:
3434
- name: 'Checkout ${{ github.ref }} ( ${{ github.sha }} )'
3535
uses: actions/checkout@v6
36+
with:
37+
persist-credentials: false
3638
- uses: actions/setup-python@v6 # https://www.python.org/
3739
with:
3840
python-version: '3.10' # Version range or exact version of a Python version to use, using SemVer's version range syntax

.github/workflows/pyflink.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ on:
3939
- 'python/**'
4040
- '.github/workflows/pyflink.yml'
4141

42+
permissions:
43+
contents: read
44+
4245
concurrency:
4346
group: ${{ github.workflow }}-${{ github.ref }}
4447
cancel-in-progress: true
@@ -51,6 +54,8 @@ jobs:
5154
python: ['3.11', '3.10']
5255
steps:
5356
- uses: actions/checkout@v6
57+
with:
58+
persist-credentials: false
5459
- uses: actions/setup-java@v5
5560
with:
5661
distribution: 'zulu'

.github/workflows/python-extension.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ jobs:
5959
working-directory: python
6060
steps:
6161
- uses: actions/checkout@v6
62+
with:
63+
persist-credentials: false
6264
- uses: actions/setup-python@v6
6365
with:
6466
python-version: ${{ matrix.python }}

0 commit comments

Comments
 (0)