Improve sample for build-scan comment on PR

This commit is contained in:
Daz DeBoer 2022-04-04 15:12:03 -06:00
parent ff8a687227
commit cde360986c
No known key found for this signature in database
GPG key ID: DD6B9F0B06683D5D
2 changed files with 16 additions and 18 deletions

View file

@ -6,16 +6,15 @@ jobs:
gradle: gradle:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - name: Checkout project sources
- uses: actions/setup-java@v2 uses: actions/checkout@v2
with: - name: Setup Gradle
distribution: temurin uses: ./
java-version: 11 - name: Run build with Gradle wrapper
- uses: ./ id: gradle
- id: gradle
working-directory: .github/workflows/samples/kotlin-dsl working-directory: .github/workflows/samples/kotlin-dsl
run: ./gradlew help run: ./gradlew build --scan
- name: "Comment build scan url" - name: "Add build scan URL as PR comment"
uses: actions/github-script@v5 uses: actions/github-script@v5
with: with:
github-token: ${{secrets.GITHUB_TOKEN}} github-token: ${{secrets.GITHUB_TOKEN}}

View file

@ -330,15 +330,14 @@ jobs:
gradle: gradle:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - name: Checkout project sources
- uses: actions/setup-java@v2 uses: actions/checkout@v2
with: - name: Setup Gradle
distribution: temurin uses: gradle/gradle-build-action@v2
java-version: 11 - name: Run build with Gradle wrapper
- uses: gradle/gradle-build-action@v2 id: gradle
- id: gradle run: ./gradlew build --scan
run: ./gradlew build - name: "Add build scan URL as PR comment"
- name: "Comment build scan url"
uses: actions/github-script@v5 uses: actions/github-script@v5
if: github.event_name == 'pull_request' && failure() if: github.event_name == 'pull_request' && failure()
with: with: