ci: skip check-run-reporter upload when its token isn't available #895
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Push Validation | ||
|
Check failure on line 1 in .github/workflows/push-validation.yml
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [master] | ||
| jobs: | ||
| validate: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| distribution: 'liberica' | ||
| java-version: '17' | ||
| cache: 'gradle' | ||
| - name: Build | ||
| run: ./gradlew jar | ||
| - name: Test | ||
| env: | ||
| JAVA_TOOL_OPTIONS: -Dtestfx.robot=glass -Dtestfx.headless=true -Dprism.verbose=true | ||
| run: ./gradlew test | ||
| - uses: actions/upload-artifact@v4 | ||
| if: failure() | ||
| with: | ||
| name: test-report | ||
| path: build/reports/tests/test/ | ||
| - name: Upload Test Report | ||
| uses: check-run-reporter/action@v2.11.1 | ||
| # always run, otherwise you'll only see results for passing builds - except on a fork PR, | ||
| # where CHECK_RUN_REPORTER_TOKEN isn't available (GitHub withholds repo secrets from | ||
| # pull_request-triggered runs originating from a fork) and the upload would just 403. | ||
| # See #694. | ||
| if: always() && secrets.CHECK_RUN_REPORTER_TOKEN != '' | ||
| with: | ||
| label: test | ||
| token: ${{ secrets.CHECK_RUN_REPORTER_TOKEN }} | ||
| report: 'build/test-results/**/*.xml' | ||
| - name: Static Code Analysis | ||
| run: ./gradlew check -x test | ||
| - name: Upload Checkstyle Report | ||
| uses: check-run-reporter/action@v2.11.1 | ||
| # always run, otherwise you'll only see results for passing builds - except on a fork PR, | ||
| # where CHECK_RUN_REPORTER_TOKEN isn't available (GitHub withholds repo secrets from | ||
| # pull_request-triggered runs originating from a fork) and the upload would just 403. | ||
| # See #694. | ||
| if: always() && secrets.CHECK_RUN_REPORTER_TOKEN != '' | ||
| with: | ||
| label: code-analysis | ||
| token: ${{ secrets.CHECK_RUN_REPORTER_TOKEN }} | ||
| report: 'build/reports/**/*.xml' | ||