👷 ci(build): enhance sonar project key configuration
- add SONAR_PROJECT_KEY environment variable for flexibility - fallback to default or file-based project key if not set
This commit is contained in:
parent
5b1d966c6e
commit
56ca1f63d4
1 changed files with 6 additions and 1 deletions
|
|
@ -32,8 +32,13 @@ jobs:
|
|||
env:
|
||||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }}
|
||||
run: |
|
||||
PROJECT_KEY=$(grep -E '^sonar.projectKey=' sonar-project.properties | cut -d= -f2 | tr -d '\r')
|
||||
PROJECT_KEY="${SONAR_PROJECT_KEY}"
|
||||
if [ -z "$PROJECT_KEY" ] && [ -f sonar-project.properties ]; then
|
||||
PROJECT_KEY=$(grep -E '^sonar.projectKey=' sonar-project.properties | cut -d= -f2 | tr -d '\r')
|
||||
fi
|
||||
PROJECT_KEY=${PROJECT_KEY:-free-games-claimer}
|
||||
docker run --rm \
|
||||
-e SONAR_HOST_URL="$SONAR_HOST_URL" \
|
||||
-e SONAR_TOKEN="$SONAR_TOKEN" \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue