question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support `pull_request_target` and `pull_request_review`

See original GitHub issue

By @NicholasBoll in https://github.com/chromaui/action/issues/56:

Github Actions now support pull requests from forks: https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/

More info about the pull_request_target event type: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target

However, the code explicitly prevents that type: https://github.com/chromaui/action/blob/c427f36903fb8c899e440bc90cb51822ef2959ed/src/main.ts#L25-L55

Here’s an example run failure: https://github.com/Workday/canvas-kit/pull/788/checks?check_run_id=1114827451

pull_request_target should be a valid event.

Note: from our testing, adding pull_request_target or changing pull_request to pull_request_target in a Pull Request will result in Github Actions not running for that pull request. The event type is supposed to run code from the base branch (the branch the PR is being merged into) which gets Actions into a state where nothing triggers.


By @marboro92 in https://github.com/chromaui/action/issues/59:

My team would like to run chromatic checks only after a review is submitted, but currently the pull_request_review event (info on this event: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_review) is not supported by chromaui.

Would it be possible to add support for pull_request_review?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ndelangencommented, Oct 22, 2020

@tmeasday not yet, but I’ll put this on my todo list to find out and assess if it’s ok to just add these events 👍

0reactions
penxcommented, May 3, 2022

I think the basic setup would look something like this

name: 'Chromatic'
on:
  pull_request_target:
    branches:
      - main
      - master
jobs:
  chromatic-deployment:
    runs-on: ubuntu-latest
    env:
      YARN_ENABLE_SCRIPTS: false
      YARN_ENABLE_IMMUTABLE_INSTALLS: false
    steps:
    - uses: actions/checkout@v2
        with:
          ref: ${{ github.event.pull_request.head.ref }}
          fetch-depth: 0
    - name: Install dependencies
      run: yarn
    - name: Publish to Chromatic
      uses: chromaui/action@v1
      with:
        projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

also, you’d need to run chromatic as normal on main, perhaps in a separate workflow

Read more comments on GitHub >

github_iconTop Results From Across the Web

About pull request reviews - GitHub Docs
Reviews allow collaborators to comment on the changes proposed in pull requests, approve the changes, or request further changes before the pull request...
Read more >
Pull request best practices - Medium
A pull request is a good way to propose and collaborate on changes to a repository. Writing good pull requests and having an...
Read more >
Create a pull request to review and merge code - Azure Repos
Learn how to create pull requests or draft pull requests in Azure Repos using Git, and add details and reviewers.
Read more >
Reviewing a pull request | Bitbucket Data Center and Server ...
The review phase of a pull request in Bitbucket Data Center and Server typically involves reviewers making comments and the author pushing ...
Read more >
Pull request overview - CollabNet user help
Pull requests become a tool to aid with code review and it is still possible for users to use the voting tools in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found