Automatically add Job Summary as PR comment

Rather than requiring a separate step to add a PR comment,
the `gradle-build-action` can now automatically add the Job Summary
as a PR comment

Fixes #1020
This commit is contained in:
daz 2024-01-01 11:58:02 -07:00
parent 24e9e9dc6b
commit 34a07dced0
No known key found for this signature in database
4 changed files with 52 additions and 13 deletions

View file

@ -10,18 +10,9 @@ jobs:
uses: actions/checkout@v4
- name: Setup Gradle
uses: ./
with:
add-pr-comment: true
- name: Run build with Gradle wrapper
id: gradle
working-directory: .github/workflow-samples/kotlin-dsl
run: ./gradlew build --scan
- name: "Add Build Scan URL as PR comment"
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'PR ready for review: ${{ steps.gradle.outputs.build-scan-url }}'
})