2023-07-22 14:49:39 +00:00
|
|
|
name: Demo adding Build Scan® comment to PR
|
2021-12-17 17:49:41 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [assigned, review_requested]
|
2021-12-08 19:51:41 +00:00
|
|
|
jobs:
|
|
|
|
gradle:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-04-04 21:12:03 +00:00
|
|
|
- name: Checkout project sources
|
2023-09-04 22:34:02 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-04-04 21:12:03 +00:00
|
|
|
- name: Setup Gradle
|
|
|
|
uses: ./
|
|
|
|
- name: Run build with Gradle wrapper
|
|
|
|
id: gradle
|
2022-04-05 15:45:02 +00:00
|
|
|
working-directory: .github/workflow-samples/kotlin-dsl
|
2022-04-04 21:12:03 +00:00
|
|
|
run: ./gradlew build --scan
|
2023-07-22 14:49:39 +00:00
|
|
|
- name: "Add Build Scan URL as PR comment"
|
2023-11-13 22:17:56 +00:00
|
|
|
uses: actions/github-script@v7
|
2021-12-08 19:51:41 +00:00
|
|
|
with:
|
|
|
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
script: |
|
2022-01-16 22:45:15 +00:00
|
|
|
github.rest.issues.createComment({
|
2021-12-08 19:51:41 +00:00
|
|
|
issue_number: context.issue.number,
|
|
|
|
owner: context.repo.owner,
|
|
|
|
repo: context.repo.repo,
|
2021-12-17 17:49:41 +00:00
|
|
|
body: 'PR ready for review: ${{ steps.gradle.outputs.build-scan-url }}'
|
2021-12-08 19:51:41 +00:00
|
|
|
})
|