This repository has been archived by the owner on Dec 6, 2022. It is now read-only.
Run chromatic directly on dependabot PRs #1179
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of this change?
As of March 2021, workflows triggered by a push event don't have access to GitHub secrets, if that event originates from a fork of the repo. As a result, PRs raised by Dependabot are not able to trigger a Chromatic run.
In #1112 we introduced a workaround:
Recently we discovered that the chromatic workflow was running multiple times against the same commit for a dependabot PR, increasing the number of snapshots and therefore the bill for chromatic.
#1177 updated the workflow to allow chromatic to be triggered by the
workflow_dispatch
event, i.e. manually. The hope was that this would let us manually run the step for dependabot PRs just before they were merged. Unfortunately, an error occurred when running the workflow manually.This PR reverts those changes and returns us to the situation where chromatic will run automatically on a dependabot PR but fail due to a lack of token. Whilst this is not ideal, it is possible to manually rerun the workflow successfully. This means that we retain chromatic checks on dependabot PRs but only have to run the workflow once, reducing the number of snapshots consumer.