Skip to content

Commit

Permalink
Add worknig example for build scan comment
Browse files Browse the repository at this point in the history
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 britter/maven-plugin-development#56 (comment) for how it looks in action.
  • Loading branch information
britter authored and eskatos committed Oct 14, 2020
1 parent 2efcc22 commit ced6c34
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions README.md
Expand Up @@ -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 }}'
})
```

0 comments on commit ced6c34

Please sign in to comment.