name: Java Maven Build & Publish Artifact on: push: branches: - main pull_request: branches: - main jobs: publish: runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v3 - name: Check for [release] in commit message id: check_release run: | if echo "${{ github.event.head_commit.message }}" | grep -q "\[release\]"; then echo "Release tag found in commit message, proceeding with the workflow..." echo "::set-output name=proceed::true" else echo "Release tag not found in commit message, stopping the workflow..." echo "::set-output name=proceed::false" fi - name: Set up JDK 17 if: steps.check_release.outputs.proceed == 'true' uses: actions/setup-java@v3 with: java-version: '17' distribution: 'temurin' cache: maven # Fügen Sie das gleiche if: Bedingung zu allen nachfolgenden Schritten hinzu # Beispiel: - name: Build with Maven if: steps.check_release.outputs.proceed == 'true' run: mvn -B package --file pom.xml # Wiederholen Sie das für alle nachfolgenden Schritte...