Skip to content

Commit

Permalink
fix(ci): conditionals (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts authored Apr 10, 2024
1 parent 57b8606 commit aa509fc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ runs:
# Triggers and conditions
if [ "${{ inputs.java-cache }}" == "maven" ]; then
sonarCmd="mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar" >> $GITHUB_OUTPUT
echo sonarCmd="mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar" >> $GITHUB_OUTPUT
elif [ "${{ inputs.java-cache }}" == "gradle" ]; then
sonarCmd="./gradlew build sonarqube --info" >> $GITHUB_OUTPUT
echo sonarCmd="./gradlew build sonarqube --info" >> $GITHUB_OUTPUT
else
echo "ERROR: inputs.java-cache = ${{ inputs.java-cache }}"
exit 1
Expand Down Expand Up @@ -142,20 +142,20 @@ runs:
if: steps.vars.outputs.triggered == 'true'
shell: bash
run: |
# Run tests
cd ${{ inputs.dir }}
${{ inputs.commands }}
### Optional SonarCloud

# If sonar_token
- if: steps.var.outputs.sonarCheck
- if: inputs.sonar_token && steps.vars.outputs.triggered == 'true'
env:
SONAR_TOKEN: ${{ inputs.sonar_token }}
shell: bash
run: |
# Run SonarCloud for ${{ inputs.java-cache }}
cd ${{ inputs.dir }}
${{ steps.var.outputs.sonarCmd }} \
${{ steps.vars.outputs.sonarCmd }} \
-Dsonar.host.url=https://sonarcloud.io ${{ inputs.sonar_args }}
### Cleanup
Expand Down

0 comments on commit aa509fc

Please sign in to comment.