This Repo builds on https://github.com/OskarAhl/Lighthouse-github-action-comment.
The complete action can be found in vercel-lighthouse-action/workflows/pr-deploy-and-audit.
An example budget can be found in vercel-lighthouse-action/lighthouse/budget.
Move the workflows
and lighthouse
directories into your repository .github
directory.
Generate and save the required secrets in your github repository settings.
- Deploy the PR using vercel-action
- Run three lighthouse audits against the vercel preview url
- Run budget assertions against the median run
- Format the score and comment on PR
- Format the assertions / budget result and comment on PR
- Pass / Fail the PR based on the budget
For this to run, you will need to generate auth tokens and save them as secrets on your repository. Please see the vercel project linking documentation for information on generating org_id and project_id.
VERCEL_TOKEN
- A vercel auth tokenORG_ID
- The linked vercel project org idPROJECT_ID
- The links vercel project idVERCEL_SCOPE
(optional) - The vercel team name if using vercel teams