2021-12-09 03:51:41 +08:00
|
|
|
name: Add a build scan comment to PR
|
2021-12-18 01:49:41 +08:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [assigned, review_requested]
|
2021-12-09 03:51:41 +08:00
|
|
|
jobs:
|
|
|
|
gradle:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-04-05 05:12:03 +08:00
|
|
|
- name: Checkout project sources
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Gradle
|
|
|
|
uses: ./
|
|
|
|
- name: Run build with Gradle wrapper
|
|
|
|
id: gradle
|
2022-04-05 23:45:02 +08:00
|
|
|
working-directory: .github/workflow-samples/kotlin-dsl
|
2022-04-05 05:12:03 +08:00
|
|
|
run: ./gradlew build --scan
|
|
|
|
- name: "Add build scan URL as PR comment"
|
2022-01-17 06:45:15 +08:00
|
|
|
uses: actions/github-script@v5
|
2021-12-09 03:51:41 +08:00
|
|
|
with:
|
|
|
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
script: |
|
2022-01-17 06:45:15 +08:00
|
|
|
github.rest.issues.createComment({
|
2021-12-09 03:51:41 +08:00
|
|
|
issue_number: context.issue.number,
|
|
|
|
owner: context.repo.owner,
|
|
|
|
repo: context.repo.repo,
|
2021-12-18 01:49:41 +08:00
|
|
|
body: 'PR ready for review: ${{ steps.gradle.outputs.build-scan-url }}'
|
2021-12-09 03:51:41 +08:00
|
|
|
})
|