mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-22 09:02:50 +00:00
add example of using the build-scan-url output in README
This commit is contained in:
parent
38eaee068d
commit
f9f0422c72
1 changed files with 27 additions and 0 deletions
27
README.md
27
README.md
|
@ -124,3 +124,30 @@ jobs:
|
|||
If your build publishes a [build scan](https://gradle.com/build-scans/) the `gradle-command-action` action will emit the link to the published build scan as an output named `build-scan-url`.
|
||||
|
||||
You can then use that link in subsequent actions of your workflow.
|
||||
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
// .github/workflows/gradle-build-pr.yml
|
||||
name: Run Gradle on PRs
|
||||
on: pull-request
|
||||
jobs:
|
||||
gradle:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
- uses: eskatos/gradle-command-action@v1
|
||||
with:
|
||||
arguments: build
|
||||
id: gradle
|
||||
- uses: example/action-that-comments-on-the-pr@v0
|
||||
if: failure()
|
||||
with:
|
||||
comment: Build failed ${{ steps.gradle.outputs.build-scan-url }}
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue