gradle-build-action/.github/workflows/pr-build-scan-comment.yml
Daz DeBoer 3c3fdfcc0c
Moved workflow samples out of .github/workflows
The `.github/workflows` directory has additional permissions attached, preventing these
files from being by the Upgrade Gradle Wrapper plugin.
2022-04-05 09:55:31 -06:00

28 lines
842 B
YAML

name: Add a build scan comment to PR
on:
pull_request:
types: [assigned, review_requested]
jobs:
gradle:
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v2
- name: Setup Gradle
uses: ./
- 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@v5
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 }}'
})