Skip to content

Commit 1cd71b8

Browse files
jennedeblesertriceo
authored andcommitted
fix(ci): safer variable injection
1 parent 1dde0ab commit 1cd71b8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/pull_request_secure.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,4 +394,7 @@ jobs:
394394
env:
395395
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
396396
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Needed to run the SonarCloud analysis
397-
run: mvn -B -Psonarcloud-analysis validate org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.organization=timefold -Dsonar.projectKey=ai.timefold:timefold-solver -Dsonar.host.url=https://sonarcloud.io -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} -Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} -Dsonar.scm.revision=${{ github.event.pull_request.head.sha }}
397+
PR_NUMBER: ${{ github.event.pull_request.number }}
398+
PR_BRANCH: ${{ github.event.pull_request.head.ref }}
399+
PR_SHA: ${{ github.event.pull_request.head.sha }}
400+
run: mvn -B -Psonarcloud-analysis validate org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.organization=timefold -Dsonar.projectKey=ai.timefold:timefold-solver -Dsonar.host.url=https://sonarcloud.io -Dsonar.pullrequest.key="$PR_NUMBER" -Dsonar.pullrequest.branch="$PR_BRANCH" -Dsonar.scm.revision="$PR_SHA"

0 commit comments

Comments
 (0)