Skip to content

Commit 9b72ddf

Browse files
committed
fix(maven): env usage
1 parent 11b677e commit 9b72ddf

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/workflows/maven-and-docker-build.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ jobs:
1010
steps:
1111
- name: Checkout
1212
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0 # For Sonar blame information
1315

1416
- name: Set up Java
1517
uses: actions/setup-java@v3
@@ -30,14 +32,13 @@ jobs:
3032
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
3133
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
3234
run: |
33-
# Replace '/' with '_' to get project key
34-
PROJECT_KEY=${${{ github.repository }}//\//_}
35+
REPO_NAME=$(echo "${{ github.repository }}" | cut -d '/' -f 2)
3536
36-
mvn verify -B -P prod "-Dstyle.color=always" \
37+
mvn verify -B -P prod,coverage "-Dstyle.color=always" \
3738
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
3839
-Dsonar.host.url="https://sonarcloud.io" \
39-
-Dsonar.organization=${{ github.repository_owner }} \
40-
-Dsonar.projectKey=$PROJECT_KEY
40+
-Dsonar.organization=soat-tech-challenge \
41+
-Dsonar.projectKey=soat-tech-challenge_$REPO_NAME
4142
4243
- name: Build and push
4344
uses: docker/build-push-action@v5

0 commit comments

Comments
 (0)