Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish build scan URL #10

Closed
jmfayard opened this issue Feb 24, 2020 · 1 comment
Closed

Publish build scan URL #10

jmfayard opened this issue Feb 24, 2020 · 1 comment

Comments

@jmfayard
Copy link

jmfayard commented Feb 24, 2020

Hello @eskatos

I tried to include the build scan URL in the github message but didn't succeed.

Build scans
If your build publishes a build scan the gradle-command-action action will emit the link to the published build scan as an output named build-scan-url.
You can then use that link in subsequent actions of your workflow.

Here is my yaml config

name: CI unit tests
on: [pull_request]
jobs:
  unittests:
    runs-on: ubuntu-latest    
    steps:
      - uses: actions/checkout@v1
      - uses: actions/setup-java@v1
        with:
          java-version: 8
      - uses: eskatos/gradle-command-action@v1
        with:
          arguments: testDebugUnitTest
      - name: Comment PR
        uses: thollander/actions-comment-pull-request@master
        if: failure()
        with:
          message: Build failed ${{ steps.gradle.outputs.build-scan-url }}
          GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}     

Expected result: Build failed https://gradle.com/s/rjfaddrnmi5dq
Actual result: Build failed

PR jmfayard/android-kiss#5

Actions: https://github.com/jmfayard/android-kiss/actions

@eskatos
Copy link
Member

eskatos commented May 10, 2020

Hey @jmfayard,

Sorry for the lag answering your question. It works for me™.

Your workflow file points to steps.gradle.outputs.build-scan-url but your step running the gradle action doesn't declare an id.

Here's the excerpt from the README:

    - uses: eskatos/gradle-command-action@v1
      with:
        arguments: build
      id: gradle
    - uses: example/action-that-comments-on-the-pr@v0
      if: failure()
      with:
        comment: Build failed ${{ steps.gradle.outputs.build-scan-url }}

The key is the 4th line id: gradle.

I'm optimistically closing this, feel free to reopen if it doesn't work for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants