diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3962e45..c6d538f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,6 @@ -name: build JAVA application -on: # multiple triggers when this workflow can run - workflow_dispatch: # also select which job to run +name: build JAVA with artifact application +on: + workflow_dispatch: # multiple triggers when this workflow can run inputs: # user to select the jobname job_name: # can be any name like a variable name description: "Select the Job to run" # desciption visible to user @@ -40,9 +40,13 @@ jobs: - name: build java code run: mvn clean package - name: Code Coverage using sonarcloud - run: mvn -B verify sonar:sonar -Dsonar.projectKey=sonar-demo-org-nov-2025_sonar-demo-org-nov-2025-project -Dsonar.organization=sonar-demo-org-nov-2025 -Dsonar.host.url=https://sonarcloud.io -Dsonar.token=$SONAR_TOKEN + run: mvn -B verify sonar:sonar -Dsonar.projectKey=sonar-qube-org-demo-nov_sonar-demo-org-nov-2025-project -Dsonar.organization=sonar-qube-org-demo-nov -Dsonar.host.url=https://sonarcloud.io -Dsonar.token=$SONAR_TOKEN env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # GITHUB_TOKEN: Automatically generated token for GitHub API authentication (with limited scope). - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN}} - + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # GITHUB_TOKEN: Automatically generated token for GitHub API authentication (with limited scope). + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN}} + - name: upload artifact to github repo + uses: actions/upload-artifact@v4 # Use the latest version + with: + name: myjava-build-artifact + path: /home/runner/work/SonarQubeCoverageJava/SonarQubeCoverageJava/target/wicket-pwnedpasswords-validator-2.0.1-SNAPSHOT.jar