gradle-build-action/.github/workflows/demo-pr-build-scan-comment.yml

28 lines
850 B
YAML
Raw Normal View History

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