-
Notifications
You must be signed in to change notification settings - Fork 339
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
Skip “Percy screenshots” when secrets are unavailable on forks #3028
Conversation
@@ -162,26 +162,10 @@ jobs: | |||
run: ${{ matrix.run }} | |||
|
|||
regression: | |||
name: Send screenshots to Percy | |||
runs-on: ubuntu-latest | |||
name: Percy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any benefit to having this inside the tests workflow, rather than just having screenshots.yml
trigger on the same pull_request
and push
events?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it gives the Install and Build steps chance to get cached
Then when we trigger the Percy workflow it can go super fast (already installed and built)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense – but I think this might be worth adding as a comment somewhere as it's not obvious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, comment added
Similar to how we only install js-beautify
in the Diff changes to dist workflow it would be nice in future (we're nearly there) to just install Percy with the Review app devDependencies
:
npm ci --workspace app
c2b4e04
to
7a81c8c
Compare
The Percy CLI requires
${{ secrets.PERCY_TOKEN }}
which forks won't necessarily have. We recently made our Percy npm script return an error code when the health check failed in:This PR adds a condition to our Send screenshots to Percy job which makes it skippable
Where permissions allow you'll see we've now added a Dependabot
PERCY_TOKEN
secret too:https://github.com/alphagov/govuk-frontend/settings/secrets/dependabot
Reducing Percy runs in future
We may want to consider a "paths" filter in future so this PR also moves the Percy uploads to a separate GitHub Actions
.github/workflows/screenshots.yml
workflow. More information in: