Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions spring-kafka-example/.github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI Build

on:
push:
branches:
- "**"

Comment on lines +3 to +7
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Run CI on pull requests as well, not only on pushes

Restricting the trigger to push means code in PRs can merge without ever running the workflow.
Add a pull_request: (and optionally workflow_dispatch:) trigger to enforce CI before merging.

 on:
+  pull_request:
+    branches: [ "**" ]
   push:
     branches:
       - "**"
🤖 Prompt for AI Agents
In spring-kafka-example/.github/workflows/maven.yml around lines 3 to 7, the
workflow is currently triggered only on push events, which means it does not run
on pull requests. To fix this, add a pull_request trigger alongside the existing
push trigger to ensure the CI workflow runs on pull requests as well.
Optionally, you can also add a workflow_dispatch trigger to allow manual
workflow runs.

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
distribution: [ 'temurin' ]
java: [ '21' ]
steps:
- uses: actions/checkout@v4

- name: Setup Java 21
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: ${{ matrix.distribution }}
cache: 'maven'

- name: Grant execute permission for mvnw
run: chmod +x mvnw

- name: Build with Maven
run: ./mvnw clean verify