1

I saw that Chromatic action is able to change the "details" link in PR check and post an additional comment. Can someone help me to set it up in my own workflow? check the image for example

Marcello Romani
  • 2,967
  • 31
  • 40

3 Answers3

0

You can create a custom check for your PR using the GitHub REST API. In particular, you want to look at Checks - Create a check run. Part of the payload for that endpoint is a field called details_url where you can specify the URL.

Sample API call with curl:

curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/check-runs \
  -d '{"name":"name","head_sha":"head_sha", "details_url": "https://my-custom-url.com"}'
rethab
  • 7,170
  • 29
  • 46
0

Seems the GitHub Actions: checks-action is a good fix to solve your problem:

jobs:
  test_something:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions/create-outputs@v0.0.0-fake
      id: test
    - uses: LouisBrunner/checks-action@v1.1.1
      if: always()
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        name: Test XYZ
        conclusion: ${{ job.status }}
        output: |
          {"summary":${{ steps.test.outputs.summary }}}

The output field could help:

output:
Supports the following properties:

summary: Required, summary of your check
text_description: Optional, a text description of your annotation (if any)

Link to Marketplace

Matteo
  • 37,680
  • 11
  • 100
  • 115
-1

I believe they are coming from an external source and not GitHub Actions. If you are using GitHub Actions I do not think this is feasible.

You can however create a deployment environment and add the url parameter to it so you can click the "View Deployment" button.

https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#using-an-environment

Hugo
  • 1