Skip to content

Commit 1ebbe20

Browse files
authored
HDDS-14920. Check actions with zizmor (#56)
1 parent d4fdb6a commit 1ebbe20

3 files changed

Lines changed: 48 additions & 7 deletions

File tree

.github/workflows/build-and-tag.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ on:
2424
branches:
2525
- 'ozone-**'
2626

27-
permissions:
28-
contents: read
29-
packages: write
27+
permissions: { }
3028

3129
jobs:
3230
build:
3331
uses: ./.github/workflows/build.yaml
32+
permissions:
33+
contents: read
34+
packages: write
3435

3536
tag:
3637
needs: build
@@ -39,6 +40,9 @@ jobs:
3940
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
4041
IMAGE_ID: ${{ needs.build.outputs.image-id }}
4142
REGISTRIES: ghcr.io # docker.io is appended dynamically
43+
permissions:
44+
contents: read
45+
packages: write
4246
steps:
4347
- name: Generate tags
4448
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0

.github/workflows/build.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,17 @@ concurrency:
3535
group: ${{ github.sha }}
3636
cancel-in-progress: false
3737

38-
permissions:
39-
contents: read
40-
packages: write
41-
4238
env:
4339
OZONE_RUNNER_IMAGE: ghcr.io/apache/ozone-runner
4440

41+
permissions: { }
42+
4543
jobs:
4644
build:
4745
runs-on: ubuntu-latest
46+
permissions:
47+
contents: read
48+
packages: write
4849
outputs:
4950
image-id: ${{ steps.meta.outputs.tags }}
5051
steps:

.github/workflows/zizmor.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: zizmor
17+
18+
on:
19+
push:
20+
pull_request:
21+
22+
permissions: { }
23+
24+
jobs:
25+
zizmor:
26+
runs-on: ubuntu-latest
27+
permissions:
28+
security-events: write
29+
steps:
30+
- name: Checkout project
31+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
32+
with:
33+
persist-credentials: false
34+
35+
- name: Run zizmor
36+
uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3

0 commit comments

Comments
 (0)