Skip to content

Commit 32466e1

Browse files
committed
ci: enhance gh workflow security
1 parent 5746a0a commit 32466e1

7 files changed

Lines changed: 43 additions & 9 deletions

File tree

.github/CODEOWNERS

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
* @fhussonnois
1+
* @fhussonnois
2+
3+
# Require explicit maintainer review for workflow and AI agent instruction files.
4+
# Any PR touching these paths must be approved by a maintainer before merge.
5+
.github/workflows/** @fhussonnois
6+
.github/CODEOWNERS @fhussonnois
7+
AGENTS.md @fhussonnois
8+
CLAUDE.md @fhussonnois

.github/workflows/docker-build-push.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ env:
1616
JAVA_DISTRO: 'zulu'
1717
GRAAL_VERSION: '25.0.1'
1818
GRAAL_DISTRIBUTION: 'graalvm-community'
19+
20+
permissions:
21+
contents: read
22+
1923
jobs:
2024
build-cli:
2125
if: github.repository == 'streamthoughts/jikkou'

.github/workflows/early-access.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ env:
1414
JAVA_DISTRO: 'zulu'
1515
GRAAL_VERSION: '25.0.1'
1616
GRAAL_DISTRIBUTION: 'graalvm-community'
17+
18+
permissions:
19+
contents: read
20+
1721
jobs:
1822
build-distribution:
1923
if: github.repository == 'streamthoughts/jikkou'
@@ -92,11 +96,12 @@ jobs:
9296
release-artifacts:
9397
needs: [ build-distribution ]
9498
runs-on: ubuntu-latest
99+
permissions:
100+
contents: write
95101
steps:
96102
- name: 'Checkout GitHub repository'
97103
uses: actions/checkout@v4
98104
with:
99-
ref: ${{ needs.set-release-version.outputs.HEAD }}
100105
fetch-depth: 0
101106

102107
- name: 'Download all artifacts'

.github/workflows/github-page.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ on:
1010
push:
1111
branches:
1212
- main
13+
14+
permissions:
15+
contents: read
16+
1317
jobs:
1418
deploy:
1519
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write
1622
concurrency:
1723
group: ${{ github.workflow }}-${{ github.ref }}
1824
steps:

.github/workflows/maven-build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ env:
1919
permissions:
2020
contents: read
2121
security-events: write
22-
pull-requests: write
2322

2423
jobs:
2524
build:
2625
name: Build and analyze
2726
runs-on: ubuntu-latest
2827
timeout-minutes: 30
28+
permissions:
29+
pull-requests: write
2930
steps:
3031
- name: 'Checkout code'
3132
uses: actions/checkout@v4

.github/workflows/maven-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
build:
2121
runs-on: ubuntu-latest
2222
permissions:
23-
contents: write
23+
contents: read
2424
steps:
2525
- name: 'Checkout GitHub repository'
2626
uses: actions/checkout@v4

.github/workflows/release.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ env:
2121
JAVA_DISTRO: 'zulu'
2222
GRAAL_VERSION: '25.0.1'
2323
GRAAL_DISTRIBUTION: 'graalvm-community'
24+
25+
permissions:
26+
contents: read
27+
2428
jobs:
2529
set-release-version:
2630
runs-on: ubuntu-latest
31+
permissions:
32+
contents: write
2733
outputs:
2834
HEAD: ${{ steps.version.outputs.HEAD }}
2935
RELEASE_VERSION: ${{ steps.version.outputs.RELEASE_VERSION }}
@@ -57,10 +63,11 @@ jobs:
5763
5864
- name: 'Set release version'
5965
id: version
66+
env:
67+
RELEASE_VERSION: ${{ github.event.inputs.version }}
68+
NEXT_VERSION: ${{ github.event.inputs.next }}
6069
run: |
61-
RELEASE_VERSION=${{ github.event.inputs.version }}
62-
NEXT_VERSION=${{ github.event.inputs.next }}
63-
if [ -z $NEXT_VERSION ]
70+
if [ -z "$NEXT_VERSION" ]
6471
then
6572
PLAIN_VERSION=`echo ${RELEASE_VERSION} | awk 'match($0, /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)/) { print substr($0, RSTART, RLENGTH); }'`
6673
NEXT_VERSION="${PLAIN_VERSION}-SNAPSHOT"
@@ -78,6 +85,8 @@ jobs:
7885
build-distribution:
7986
needs: [ set-release-version ]
8087
name: 'Build with GraalVM on ${{ matrix.os }}'
88+
permissions:
89+
contents: read
8190
strategy:
8291
fail-fast: true
8392
matrix:
@@ -153,6 +162,8 @@ jobs:
153162
release-artifacts:
154163
needs: [ set-release-version, build-distribution ]
155164
runs-on: ubuntu-latest
165+
permissions:
166+
contents: write
156167
steps:
157168
- name: 'Checkout GitHub repository'
158169
uses: actions/checkout@v4
@@ -207,7 +218,7 @@ jobs:
207218
env:
208219
NEXT_VERSION: ${{ needs.set-release-version.outputs.NEXT_VERSION }}
209220
run: |
210-
./mvnw -ntp -B versions:set versions:commit -DnewVersion=${{ env.NEXT_VERSION }}
221+
./mvnw -ntp -B versions:set versions:commit -DnewVersion="$NEXT_VERSION"
211222
find . -name 'pom.xml' | xargs git add
212-
git commit -m "ci: bump version for next iteration to ${{ env.NEXT_VERSION }} 🤖"
223+
git commit -m "ci: bump version for next iteration to $NEXT_VERSION"
213224
git push origin HEAD:${GITHUB_REF#refs/heads/}

0 commit comments

Comments
 (0)