mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-26 02:52:09 +00:00
Add worknig example for build scan comment
Replaces the dummy example for how to automatically add a comment containing the build scan URL with a working example using the [GitHub Script action](https://github.com/marketplace/actions/github-script#comment-on-an-issue). See https://github.com/britter/maven-plugin-development/pull/56#issuecomment-708406163 for how it looks in action.
This commit is contained in:
parent
2efcc22ff5
commit
ced6c34563
1 changed files with 11 additions and 3 deletions
14
README.md
14
README.md
|
@ -210,8 +210,16 @@ jobs:
|
|||
with:
|
||||
arguments: build
|
||||
id: gradle
|
||||
- uses: example/action-that-comments-on-the-pr@v0
|
||||
if: failure()
|
||||
- name: "Comment build scan url"
|
||||
uses: actions/github-script@v3
|
||||
if: github.event_name == 'pull_request' && failure()
|
||||
with:
|
||||
comment: Build failed ${{ steps.gradle.outputs.build-scan-url }}
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
github.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: '❌ ${{ github.workflow }} failed: ${{ steps.gradle.outputs.build-scan-url }}'
|
||||
})
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue