Skip to content

ci: skip check-run-reporter upload when its token isn't available #895

ci: skip check-run-reporter upload when its token isn't available

ci: skip check-run-reporter upload when its token isn't available #895

Workflow file for this run

name: Push Validation

Check failure on line 1 in .github/workflows/push-validation.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/push-validation.yml

Invalid workflow file

(Line: 38, Col: 11): Unrecognized named-value: 'secrets'. Located at position 13 within expression: always() && secrets.CHECK_RUN_REPORTER_TOKEN != '', (Line: 51, Col: 11): Unrecognized named-value: 'secrets'. Located at position 13 within expression: always() && secrets.CHECK_RUN_REPORTER_TOKEN != ''
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'