Skip to content

Run sonar as a separate job to avoid PRs running it #210

Run sonar as a separate job to avoid PRs running it

Run sonar as a separate job to avoid PRs running it #210

Workflow file for this run

name: build
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew spotlessCheck build
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Sonar
if: secrets.SONAR_TOKEN != ''

Check failure on line 29 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / build

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 29, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.SONAR_TOKEN != ''

Check failure on line 29 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / build

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 29, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.SONAR_TOKEN != ''
run: ./gradlew jacocoTestReport sonar
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}