Skip to content

Commit 7aaecdc

Browse files
authored
Merge pull request #33 from bci-oss/32-add-zizmor-action-step
Add zizmor.yml for SAST
2 parents 257f232 + 1b1730e commit 7aaecdc

File tree

3 files changed

+56
-11
lines changed

3 files changed

+56
-11
lines changed

.github/workflows/pull-request-check.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,27 @@ name: Check Pull Request
22
on:
33
pull_request:
44
branches: [ main ]
5+
permissions: {}
56
jobs:
67
build-test:
8+
permissions:
9+
contents: read
10+
pull-requests: read
711
runs-on: ubuntu-latest
812
name: "Build"
913

1014
steps:
1115
- name: Checkout
12-
uses: actions/checkout@v4
16+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
1317

1418
- name: Set up JDK 17
15-
uses: actions/setup-java@v4
19+
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e #v5.1.0
1620
with:
1721
distribution: 'temurin'
1822
java-version: '17'
1923

2024
- name: Cache Maven packages
21-
uses: actions/cache@v3
25+
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb #v5.0.1
2226
with:
2327
path: ~/.m2/repository
2428
key: maven-${{ hashFiles('**/pom.xml') }}

.github/workflows/release.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,25 @@ on:
55
release_version:
66
description: 'Version number of the release'
77
required: true
8+
env:
9+
RELEASE_VERSION: ${{ github.event.inputs.release_version }}
10+
permissions: {}
811
jobs:
912
build-and-release:
13+
permissions:
14+
contents: write
15+
actions: read
16+
issues: write
17+
pull-requests: write
1018
runs-on: ubuntu-latest
1119
name: "Build and release"
1220

1321
steps:
1422
- name: Checkout
15-
uses: actions/checkout@v4
23+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
1624

1725
- name: Set up JDK 17
18-
uses: actions/setup-java@v4
26+
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e #v5.1.0
1927
with:
2028
distribution: 'temurin'
2129
java-version: '17'
@@ -29,7 +37,7 @@ jobs:
2937
- name: Build artifact and release to Maven Central
3038
run: |
3139
set -x
32-
./mvnw -B versions:set -DnewVersion=${{ github.event.inputs.release_version }}
40+
./mvnw -B versions:set -DnewVersion=${RELEASE_VERSION}
3341
./mvnw -B versions:commit
3442
./mvnw -B -U clean deploy -Psign,release-build
3543
env:
@@ -42,20 +50,20 @@ jobs:
4250
# - Create Github release
4351

4452
- name: Commit version changes and push to upstream repository
45-
uses: stefanzweifel/git-auto-commit-action@v4
53+
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
4654
with:
4755
branch: main
4856
commit_user_name: github-actions
4957
commit_user_email: github-actions@github.com
5058
commit_author: Actions <actions@github.com>
51-
commit_message: "Set to version ${{ github.event.inputs.release_version }}"
59+
commit_message: "Set to version ${{ env.RELEASE_VERSION }}"
5260
file_pattern: 'pom.xml'
5361

5462
- name: Create GitHub release
55-
uses: softprops/action-gh-release@v1
63+
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
5664
with:
5765
body: "Create Github release"
58-
tag_name: v${{ github.event.inputs.release_version }}
66+
tag_name: v${{ env.RELEASE_VERSION }}
5967
target_commitish: main
6068
draft: false
6169
prerelease: false
@@ -69,7 +77,7 @@ jobs:
6977
./mvnw -B versions:commit
7078
7179
- name: Commit version changes and push to upstream repository
72-
uses: stefanzweifel/git-auto-commit-action@v4
80+
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
7381
with:
7482
branch: main
7583
commit_user_name: github-actions

.github/workflows/zizmor.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#
2+
# Copyright (c) 2026 Robert Bosch Manufacturing Solutions GmbH, Germany. All rights reserved.
3+
#
4+
name: GitHub Actions SAST (zizmor)
5+
6+
on:
7+
pull_request:
8+
branches: [ main ]
9+
push:
10+
branches: [ main ]
11+
12+
permissions: {}
13+
14+
jobs:
15+
zizmor:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
23+
with:
24+
persist-credentials: false
25+
26+
- name: Run zizmor (PR annotations)
27+
uses: zizmorcore/zizmor-action@e639db99335bc9038abc0e066dfcd72e23d26fb4 # v0.3.0
28+
with:
29+
advanced-security: false
30+
version: v1.22.0
31+
annotations: true
32+
persona: auditor
33+
min-severity: medium

0 commit comments

Comments
 (0)