fix: reinstate old sonarcloud.yml with current jdk fix for sonarcloud (DCD-5125) - #423
fix: reinstate old sonarcloud.yml with current jdk fix for sonarcloud (DCD-5125)#423LukasKuzavas wants to merge 1 commit into
Conversation
|
🤖 Hi @LukasKuzavas, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
There was a problem hiding this comment.
This Pull Request aims to reinstate an older single-job version of the sonarcloud.yml workflow while retaining the JDK 21 update required for running the SonarCloud scanner. While simplifying the workflow structure is understandable, this change introduces multiple high-severity bugs, schema validation errors, and action version regressions that will break caller repositories.
🔍 General Feedback
- Input Configuration Inconsistencies: Multiple inputs like
working-directoryandrepo-nameare referenced in step execution but have been deleted or omitted from theinputsblock, which will break any external workflow calling this shared action. - Workflow Action Version Regressions: Several core GitHub Actions (checkout, setup-node, and gradle-build-action) were downgraded to deprecated or outdated versions, triggering Node.js runtime deprecation warnings.
- Missing Sonar Cloud Configurations: The omission of
GITHUB_TOKENfrom the Sonar step prevents the scanner from reporting findings directly back to PR checks.
| version: | ||
| description: Application version | ||
| required: false | ||
| type: string | ||
| working-directory: | ||
| description: Project working directory | ||
| required: false | ||
| type: string |
There was a problem hiding this comment.
| version: | |
| description: Application version | |
| required: false | |
| type: string | |
| working-directory: | |
| description: Project working directory | |
| required: false | |
| type: string | |
| version: | |
| required: false | |
| type: string | |
| working-directory: | |
| required: false | |
| type: string | |
| default: '.' | |
| repo-name: | |
| required: false | |
| type: string |
| echo "dockerPassword=${{ secrets.JFROG_PASSWORD }}" >> ~/.gradle/gradle.properties | ||
| echo "dockerEmail=platformmanageteam@genesis.global" >> ~/.gradle/gradle.properties | ||
|
|
||
| echo "genesis-home=../.genesis-home" >> ~/.gradle/gradle.properties | ||
| echo "deploy-plugin-mode=local" >> ~/.gradle/gradle.properties | ||
| sudo chmod +x ./gradlew | ||
| sudo chmod +x ./${{ inputs.server-path }}/gradlew | ||
| sudo chmod -R +rx ./${{ inputs.server-path }}/ | ||
| cat ~/.gradle/gradle.properties >> ./gradle.properties | ||
| if [ -z "${{ inputs.repo-name }}" ]; then | ||
| echo "REPO_NAME=$(echo '${{ github.event.repository.name }}' | cut -d'-' -f1)" >> $GITHUB_ENV | ||
| else | ||
| echo "REPO_NAME=${{ inputs.repo-name }}" >> $GITHUB_ENV | ||
| fi | ||
| - name: Set up Gradle | ||
| uses: gradle/actions/setup-gradle@v4 | ||
| RELEASE_VERSION=$(echo "${{ inputs.version }}" | sed 's/\//-/g') | ||
| echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV | ||
| sed -E -i "s/^\s{4}version = \".+\"/ version = \"${RELEASE_VERSION}\"/g" ${{ inputs.server-path }}/build.gradle.kts | ||
|
|
||
| - name: Server Build | ||
| uses: gradle/gradle-build-action@v2 | ||
| with: | ||
| arguments: test jacocoTestReport --no-configuration-cache |
There was a problem hiding this comment.
| echo "dockerPassword=${{ secrets.JFROG_PASSWORD }}" >> ~/.gradle/gradle.properties | |
| echo "dockerEmail=platformmanageteam@genesis.global" >> ~/.gradle/gradle.properties | |
| echo "genesis-home=../.genesis-home" >> ~/.gradle/gradle.properties | |
| echo "deploy-plugin-mode=local" >> ~/.gradle/gradle.properties | |
| sudo chmod +x ./gradlew | |
| sudo chmod +x ./${{ inputs.server-path }}/gradlew | |
| sudo chmod -R +rx ./${{ inputs.server-path }}/ | |
| cat ~/.gradle/gradle.properties >> ./gradle.properties | |
| if [ -z "${{ inputs.repo-name }}" ]; then | |
| echo "REPO_NAME=$(echo '${{ github.event.repository.name }}' | cut -d'-' -f1)" >> $GITHUB_ENV | |
| else | |
| echo "REPO_NAME=${{ inputs.repo-name }}" >> $GITHUB_ENV | |
| fi | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| RELEASE_VERSION=$(echo "${{ inputs.version }}" | sed 's/\//-/g') | |
| echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV | |
| sed -E -i "s/^\s{4}version = \".+\"/ version = \"${RELEASE_VERSION}\"/g" ${{ inputs.server-path }}/build.gradle.kts | |
| - name: Server Build | |
| uses: gradle/gradle-build-action@v2 | |
| with: | |
| arguments: test jacocoTestReport --no-configuration-cache | |
| run: | | |
| mkdir -p ~/.gradle/ | |
| echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV | |
| echo "genesisArtifactoryUser=${{ secrets.JFROG_USERNAME }}" > ~/.gradle/gradle.properties | |
| echo "genesisArtifactoryPassword=${{ secrets.JFROG_PASSWORD }}" >> ~/.gradle/gradle.properties | |
| echo "systemProp.org.gradle.internal.http.connectionTimeout=180000" >> ~/.gradle/gradle.properties | |
| echo "systemProp.org.gradle.internal.http.socketTimeout=180000" >> ~/.gradle/gradle.properties | |
| echo "dockerUrl=genesisglobal-docker-internal.jfrog.io" >> ~/.gradle/gradle.properties | |
| echo "dockerUsername=${{ secrets.JFROG_USERNAME }}" >> ~/.gradle/gradle.properties | |
| echo "dockerPassword=${{ secrets.JFROG_PASSWORD }}" >> ~/.gradle/gradle.properties | |
| echo "dockerEmail=platformmanageteam@genesis.global" >> ~/.gradle/gradle.properties | |
| echo "genesis-home=../.genesis-home" >> ~/.gradle/gradle.properties | |
| echo "deploy-plugin-mode=local" >> ~/.gradle/gradle.properties | |
| if [ -n "${GRADLE_PROPERTIES:-}" ]; then | |
| printf '%s\n' "${GRADLE_PROPERTIES}" >> ~/.gradle/gradle.properties | |
| fi | |
| chmod +x ./gradlew | |
| chmod +x ./${{ inputs.server-path }}/gradlew | |
| chmod -R +rx ./${{ inputs.server-path }}/ | |
| cat ~/.gradle/gradle.properties >> ./gradle.properties | |
| if [ -z "${{ inputs.repo-name }}" ]; then | |
| echo "REPO_NAME=$(echo '${{ github.event.repository.name }}' | cut -d'-' -f1)" >> $GITHUB_ENV | |
| else | |
| echo "REPO_NAME=${{ inputs.repo-name }}" >> $GITHUB_ENV | |
| fi | |
| RELEASE_VERSION=$(echo "${{ inputs.version }}" | sed 's/\//-/g') | |
| echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV | |
| BUILD_FILE="${{ inputs.server-path }}/build.gradle.kts" | |
| if [ -n "${RELEASE_VERSION}" ] && [ -f "${BUILD_FILE}" ]; then | |
| sed -E -i "s/^\s{4}version = \".+\"/ version = \"${RELEASE_VERSION}\"/g" "${BUILD_FILE}" | |
| fi |
| env: | ||
| GRADLE_PROPERTIES: ${{ secrets.GRADLE_PROPERTIES }} | ||
| run: | | ||
| set -euo pipefail | ||
| mkdir -p "${HOME}/.gradle" | ||
| echo "GRADLE_USER_HOME=${HOME}/.gradle" >> "${GITHUB_ENV}" | ||
| { | ||
| echo "genesisArtifactoryUser=${{ secrets.JFROG_USERNAME }}" | ||
| echo "genesisArtifactoryPassword=${{ secrets.JFROG_PASSWORD }}" | ||
| echo "systemProp.org.gradle.internal.http.connectionTimeout=180000" | ||
| echo "systemProp.org.gradle.internal.http.socketTimeout=180000" | ||
| echo "dockerUrl=genesisglobal-docker-internal.jfrog.io" | ||
| echo "dockerUsername=${{ secrets.JFROG_USERNAME }}" | ||
| echo "dockerPassword=${{ secrets.JFROG_PASSWORD }}" | ||
| echo "dockerEmail=${{ secrets.JFROG_EMAIL }}" | ||
| echo "genesis-home=../.genesis-home" | ||
| echo "deploy-plugin-mode=local" | ||
| } > "${HOME}/.gradle/gradle.properties" | ||
| if [ -n "${GRADLE_PROPERTIES:-}" ]; then | ||
| printf '%s\n' "${GRADLE_PROPERTIES}" >> "${HOME}/.gradle/gradle.properties" | ||
| fi | ||
| if [ -f ./gradlew ]; then | ||
| chmod +x ./gradlew | ||
| fi | ||
| if [ -f "./${{ inputs.server-path }}/gradlew" ]; then | ||
| chmod +x "./${{ inputs.server-path }}/gradlew" | ||
| fi | ||
| if [ -d "./${{ inputs.server-path }}" ]; then | ||
| chmod -R +rx "./${{ inputs.server-path }}" | ||
| fi | ||
| cat "${HOME}/.gradle/gradle.properties" >> ./gradle.properties | ||
| RELEASE_VERSION="$(echo '${{ inputs.version }}' | sed 's/\//-/g')" | ||
| BUILD_FILE="${{ inputs.server-path }}/build.gradle.kts" | ||
| if [ -n "${RELEASE_VERSION}" ] && [ -f "${BUILD_FILE}" ]; then | ||
| sed -E -i "s/^[[:space:]]{4}version = \".+\"/ version = \"${RELEASE_VERSION}\"/g" "${BUILD_FILE}" | ||
| fi | ||
| - name: Set up Gradle | ||
| uses: gradle/actions/setup-gradle@v4 | ||
| SONAR_TOKEN: ${{ secrets.JENKINSGENESIS_SONAR }} |
There was a problem hiding this comment.
| env: | |
| GRADLE_PROPERTIES: ${{ secrets.GRADLE_PROPERTIES }} | |
| run: | | |
| set -euo pipefail | |
| mkdir -p "${HOME}/.gradle" | |
| echo "GRADLE_USER_HOME=${HOME}/.gradle" >> "${GITHUB_ENV}" | |
| { | |
| echo "genesisArtifactoryUser=${{ secrets.JFROG_USERNAME }}" | |
| echo "genesisArtifactoryPassword=${{ secrets.JFROG_PASSWORD }}" | |
| echo "systemProp.org.gradle.internal.http.connectionTimeout=180000" | |
| echo "systemProp.org.gradle.internal.http.socketTimeout=180000" | |
| echo "dockerUrl=genesisglobal-docker-internal.jfrog.io" | |
| echo "dockerUsername=${{ secrets.JFROG_USERNAME }}" | |
| echo "dockerPassword=${{ secrets.JFROG_PASSWORD }}" | |
| echo "dockerEmail=${{ secrets.JFROG_EMAIL }}" | |
| echo "genesis-home=../.genesis-home" | |
| echo "deploy-plugin-mode=local" | |
| } > "${HOME}/.gradle/gradle.properties" | |
| if [ -n "${GRADLE_PROPERTIES:-}" ]; then | |
| printf '%s\n' "${GRADLE_PROPERTIES}" >> "${HOME}/.gradle/gradle.properties" | |
| fi | |
| if [ -f ./gradlew ]; then | |
| chmod +x ./gradlew | |
| fi | |
| if [ -f "./${{ inputs.server-path }}/gradlew" ]; then | |
| chmod +x "./${{ inputs.server-path }}/gradlew" | |
| fi | |
| if [ -d "./${{ inputs.server-path }}" ]; then | |
| chmod -R +rx "./${{ inputs.server-path }}" | |
| fi | |
| cat "${HOME}/.gradle/gradle.properties" >> ./gradle.properties | |
| RELEASE_VERSION="$(echo '${{ inputs.version }}' | sed 's/\//-/g')" | |
| BUILD_FILE="${{ inputs.server-path }}/build.gradle.kts" | |
| if [ -n "${RELEASE_VERSION}" ] && [ -f "${BUILD_FILE}" ]; then | |
| sed -E -i "s/^[[:space:]]{4}version = \".+\"/ version = \"${RELEASE_VERSION}\"/g" "${BUILD_FILE}" | |
| fi | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| SONAR_TOKEN: ${{ secrets.JENKINSGENESIS_SONAR }} | |
| env: | |
| SONAR_TOKEN: ${{ secrets.JENKINSGENESIS_SONAR }} | |
| GITHUB_TOKEN: ${{ github.token }} |
| uses: gradle/actions/setup-gradle@v4 | ||
| SONAR_TOKEN: ${{ secrets.JENKINSGENESIS_SONAR }} | ||
| with: | ||
| arguments: sonarqube --no-configuration-cache -Dsonar.token=${{env.SONAR_TOKEN}} |
There was a problem hiding this comment.
| arguments: sonarqube --no-configuration-cache -Dsonar.token=${{env.SONAR_TOKEN}} | |
| arguments: sonarqube --no-configuration-cache -Dsonar.token=${{env.SONAR_TOKEN}} -Dsonar.gradle.skipCompile=true |
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v3 |
There was a problem hiding this comment.
| - uses: actions/checkout@v3 | |
| - uses: actions/checkout@v4 |
| uses: actions/setup-node@v2 | ||
| with: | ||
| node-version: ${{ inputs.node_version }} | ||
| - name: Configure Node if using JFrog npm packages | ||
|
|
||
| - name: Configure Node if using JFROG npm packages | ||
| if: ${{ inputs.REGISTRY_URL }} | ||
| uses: actions/setup-node@v4 | ||
| uses: actions/setup-node@v2 | ||
| with: | ||
| node-version: ${{ inputs.node_version }} | ||
| registry-url: ${{ inputs.REGISTRY_URL }} | ||
| scope: ${{ inputs.SCOPE }} |
There was a problem hiding this comment.
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: ${{ inputs.node_version }} | |
| - name: Configure Node if using JFrog npm packages | |
| - name: Configure Node if using JFROG npm packages | |
| if: ${{ inputs.REGISTRY_URL }} | |
| uses: actions/setup-node@v4 | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: ${{ inputs.node_version }} | |
| registry-url: ${{ inputs.REGISTRY_URL }} | |
| scope: ${{ inputs.SCOPE }} | |
| - name: Configure Node | |
| if: ${{ !inputs.REGISTRY_URL }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ inputs.node_version }} | |
| - name: Configure Node if using JFROG npm packages | |
| if: ${{ inputs.REGISTRY_URL }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ inputs.node_version }} | |
| registry-url: ${{ inputs.REGISTRY_URL }} | |
| scope: ${{ inputs.SCOPE }} |
| sed -E -i "s/^\s{4}version = \".+\"/ version = \"${RELEASE_VERSION}\"/g" ${{ inputs.server-path }}/build.gradle.kts | ||
|
|
||
| - name: Server Build | ||
| uses: gradle/gradle-build-action@v2 |
There was a problem hiding this comment.
| uses: gradle/gradle-build-action@v2 | |
| - name: Server Build | |
| uses: gradle/actions/setup-gradle@v4 |
| distribution: 'temurin' | ||
|
|
||
| - name: SonarCloud analysis | ||
| uses: gradle/gradle-build-action@v2 |
There was a problem hiding this comment.
| uses: gradle/gradle-build-action@v2 | |
| - name: SonarCloud analysis | |
| uses: gradle/actions/setup-gradle@v4 |
No description provided.