Skip to content
Open
Changes from 6 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
48 changes: 35 additions & 13 deletions action-templates/actions/action-maven-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ inputs:
app-path:
description: "Path to the project’s pom.xml file"
required: true
releaseMethod:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why not kebab case?

@hupling hupling Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ja, weil ich es so gemacht habe, wie bei releaseVersion. dann machen wir alles in kebal case außer releaseVersiom wegen Altbestand

description: "Release-Methode = patch, minor oder major"
required: false

@coderabbitai coderabbitai Bot Jul 29, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Reject invalid release methods instead of silently producing a patch release.

An unset or misspelled value (for example, mionr) falls through to the patch path. Declare patch as the default and validate patch|minor|major before computing the next version.

Proposed fix
   releaseMethod:
     description: "Release-Methode = patch, minor oder major"
     required: false
+    default: "patch"
+        case "$RELEASE_METHOD" in
+          patch|minor|major) ;;
+          *) echo "Invalid releaseMethod: $RELEASE_METHOD" >&2; exit 1 ;;
+        esac
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
releaseMethod:
description: "Release-Methode = patch, minor oder major"
required: false
releaseMethod:
description: "Release-Methode = patch, minor oder major"
required: false
default: "patch"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@action-templates/actions/action-maven-release/action.yml` around lines 11 -
13, Update the releaseMethod input in the action configuration to default to
patch and validate that its value is exactly patch, minor, or major before the
next-version calculation. Reject unset or invalid values such as mionr instead
of allowing them to fall through to patch behavior.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why did you close that?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

gh api graphql \
  -F owner="it-at-m" \
  -F name="lhm_actions" \
  -F number="342" \
  -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          id
          isResolved
          resolvedBy { login }
          comments(first: 20) {
            nodes {
              databaseId
              author { login }
              body
              createdAt
            }
          }
        }
      }
    }
  }
}' \
  --jq '
    .data.repository.pullRequest.reviewThreads.nodes[]
    | select(any(.comments.nodes[]; .databaseId == 3672365573))
    | {
        id,
        isResolved,
        resolvedBy: (.resolvedBy.login // null),
        comments: [.comments.nodes[] | {
          databaseId,
          author: .author.login,
          createdAt,
          body
        }]
      }
  '

Length of output: 3660


@simonhir, I didn’t close it—the GitHub API reports that the thread is still unresolved, with no resolvedBy user.

The patch default is now present, which covers an omitted input, but invalid values such as mionr are still not validated and would silently follow the patch path.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

how should i validate?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!


Comment thread
hupling marked this conversation as resolved.
Outdated
releaseVersion:
description: "Version to be released"
required: true
developmentVersion:
description: "Next version with snapshot"
required: true
required: false

Comment thread
hupling marked this conversation as resolved.
Outdated
skipDeployment:
description: "Skip deployment to Maven Central"
default: "true"
Expand All @@ -40,7 +42,7 @@ inputs:
outputs:
MVN_ARTIFACT_ID:
description: "Artifact name from pom"
value: ${{ steps.maven-release-step.outputs.MVN_ARTIFACT_ID }}
value: ${{ steps.maven-release-step.outputs.RELEASE }}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
Comment thread
hupling marked this conversation as resolved.
Outdated
artifact-name:
description: "Name of the artifact upload"
value: ${{steps.artifact-name.outputs.artifact-name}}
Expand Down Expand Up @@ -97,13 +99,36 @@ runs:
USE_PR: ${{ inputs.use-pr != 'true' }}
APP_PATH: ${{inputs.app-path}}
RELEASE_VERSION: ${{ inputs.releaseVersion }}
DEPLOYMENT_VERSION: ${{ inputs.developmentVersion }}
# DEPLOYMENT_VERSION: ${{ inputs.developmentVersion }}
Comment thread
hupling marked this conversation as resolved.
Outdated
RELEASE_METHOD: ${{ inputs.releaseMethod }}
DARGUMENTS: ${{ inputs.mavenDArgsInput }}
run: |
# configure git
git config --global user.email "github-actions@github.com"
git config --global user.name "GitHub Actions"

# get maven artifact id and provide as output
MVN_ARTIFACT_ID=$(mvn -f ./$APP_PATH/pom.xml org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.artifactId -DforceStdout | tee /dev/stderr | tail -n 1)
echo $MVN_ARTIFACT_ID
echo "MVN_ARTIFACT_ID=$MVN_ARTIFACT_ID" >> $GITHUB_OUTPUT

MVN_VERSION=$(mvn -f $APP_PATH/pom.xml $MAVEN_CLI_OPTS org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout )

if [ -v $RELEASE_VERSION ]; then RELEASE="${MVN_VERSION/-SNAPSHOT/""}"; else RELEASE=$RELEASE_VERSION; fi
Comment thread
hupling marked this conversation as resolved.
Outdated
echo $RELEASE
if [ "$RELEASE_METHOD" == "major" ]; then MAJOR=$(( $(echo $RELEASE | awk -F. '{print $1}') + 1 )); else MAJOR=$(echo $RELEASE | awk -F. '{print $1}'); fi
Comment thread
hupling marked this conversation as resolved.
Outdated
if [ "$RELEASE_METHOD" == "major" ]; then MINOR=0; elif [ "$RELEASE_METHOD" == "minor" ]; then MINOR=$(( $(echo $RELEASE | awk -F. '{print $2}' ) + 1 )); else MINOR=$(echo $RELEASE | awk -F. '{print $2}' ); fi
if [ "$RELEASE_METHOD" != "major" ] && [ "$RELEASE_METHOD" != "minor" ]; then PATCH=$(( $(echo $RELEASE | awk -F. '{print $3}') + 1 )); else PATCH=0; fi
DEVELOPMENT_VERSION=$(echo $MAJOR.$MINOR.$PATCH-SNAPSHOT)
echo "apfel"
Comment thread
hupling marked this conversation as resolved.
Outdated
echo $MVN_ARTIFACT_IDe

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
echo $MVN_ARTIFACT_IDe
echo $MVN_ARTIFACT_ID

why print again?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

das war zu test zwecken. weil es einfach nicht funktioniert hat entferne ich wieder

echo RELEASE=$RELEASE >> $GITHUB_OUTPUT
echo $DEVELOPMENT_VERSION
echo "DEVELOPMENT_VERSION=$DEVELOPMENT_VERSION" >> $GITHUB_OUTPUT




# prepare the maven arguments
MAVEN_ARGS="-DpushChanges=$USE_PR -DremoteTagging=false -DlocalCheckout=true"
# set maven deploy skip if skipDeployment is true
Expand All @@ -113,13 +138,10 @@ runs:

# run maven release
mvn release:prepare release:perform -f ./$APP_PATH/pom.xml -B \
-DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEPLOYMENT_VERSION \
-DreleaseVersion=$RELEASE -DdevelopmentVersion=$DEVELOPMENT_VERSION \
$MAVEN_ARGS \
-Darguments="$DARGUMENTS"
# get maven artifact id and provide as output
MVN_ARTIFACT_ID=$(mvn -f ./$APP_PATH/pom.xml org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.artifactId -q -DforceStdout)
echo $MVN_ARTIFACT_ID
echo "MVN_ARTIFACT_ID=$MVN_ARTIFACT_ID" >> $GITHUB_OUTPUT

- id: artifact-name
name: Set output variable $GITHUB_OUTPUT
run: echo "artifact-name=${{hashFiles(format('./{0}/pom.xml', inputs.app-path))}}" >> "$GITHUB_OUTPUT"
Expand All @@ -135,8 +157,8 @@ runs:
if: ${{ inputs.use-pr == 'true' }}
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
title: "chore(${{ inputs.app-path }}): bump release version to ${{ inputs.developmentVersion }}"
branch: "release-${{ inputs.app-path }}-${{ inputs.developmentVersion }}"
title: "chore(${{ inputs.app-path }}): bump release version to ${{ steps.maven-release-step.outputs.DEVELOPMENT_VERSION }}"
branch: "release-${{ inputs.app-path }}-${{ steps.maven-release-step.outputs.DEVELOPMENT_VERSION }}"
base: "${{ github.ref_name }}"
body: "This PR is auto-generated"
assignees: "${{ github.actor }}"
Loading