mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-23 01:22:50 +00:00
333078158e
Instead of a binary true/false option, it is now possible to only add a Job Summary when the build failed. This applies both to the overall Job Summary added to the workflow run, and to the new PR comment feature.
47 lines
1.3 KiB
YAML
47 lines
1.3 KiB
YAML
name: Demo adding Build Scan® comment to PR
|
|
on:
|
|
pull_request:
|
|
types: [assigned, review_requested]
|
|
jobs:
|
|
successful-build-with-always-comment:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout project sources
|
|
uses: actions/checkout@v4
|
|
- name: Setup Gradle
|
|
uses: ./
|
|
with:
|
|
add-job-summary-as-pr-comment: always
|
|
- name: Run build with Gradle wrapper
|
|
id: gradle
|
|
working-directory: .github/workflow-samples/kotlin-dsl
|
|
run: ./gradlew build --scan
|
|
|
|
successful-build-with-comment-on-failure:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout project sources
|
|
uses: actions/checkout@v4
|
|
- name: Setup Gradle
|
|
uses: ./
|
|
with:
|
|
add-job-summary-as-pr-comment: on-failure
|
|
- name: Run build with Gradle wrapper
|
|
id: gradle
|
|
working-directory: .github/workflow-samples/kotlin-dsl
|
|
run: ./gradlew build --scan
|
|
|
|
failing-build-with-comment-on-failure:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout project sources
|
|
uses: actions/checkout@v4
|
|
- name: Setup Gradle
|
|
uses: ./
|
|
with:
|
|
add-job-summary-as-pr-comment: on-failure
|
|
- name: Run build with Gradle wrapper
|
|
id: gradle
|
|
working-directory: .github/workflow-samples/kotlin-dsl
|
|
run: ./gradlew no-a-real-task --scan
|
|
continue-on-error: true
|