From cde360986c9af00730ea2672524c6412e67ae314 Mon Sep 17 00:00:00 2001 From: Daz DeBoer Date: Mon, 4 Apr 2022 15:12:03 -0600 Subject: [PATCH] Improve sample for build-scan comment on PR --- .github/workflows/pr-build-scan-comment.yml | 17 ++++++++--------- README.md | 17 ++++++++--------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/pr-build-scan-comment.yml b/.github/workflows/pr-build-scan-comment.yml index 2898ad0..ff017e1 100644 --- a/.github/workflows/pr-build-scan-comment.yml +++ b/.github/workflows/pr-build-scan-comment.yml @@ -6,16 +6,15 @@ jobs: gradle: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 - with: - distribution: temurin - java-version: 11 - - uses: ./ - - id: gradle + - name: Checkout project sources + uses: actions/checkout@v2 + - name: Setup Gradle + uses: ./ + - name: Run build with Gradle wrapper + id: gradle working-directory: .github/workflows/samples/kotlin-dsl - run: ./gradlew help - - name: "Comment build scan url" + run: ./gradlew build --scan + - name: "Add build scan URL as PR comment" uses: actions/github-script@v5 with: github-token: ${{secrets.GITHUB_TOKEN}} diff --git a/README.md b/README.md index 834e2df..b1759c8 100644 --- a/README.md +++ b/README.md @@ -330,15 +330,14 @@ jobs: gradle: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 - with: - distribution: temurin - java-version: 11 - - uses: gradle/gradle-build-action@v2 - - id: gradle - run: ./gradlew build - - name: "Comment build scan url" + - name: Checkout project sources + uses: actions/checkout@v2 + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + - name: Run build with Gradle wrapper + id: gradle + run: ./gradlew build --scan + - name: "Add build scan URL as PR comment" uses: actions/github-script@v5 if: github.event_name == 'pull_request' && failure() with: