Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Uses **Git Flow** (see `docs/gitflow.md`).

- Use `.github/PULL_REQUEST_TEMPLATE.md` for the body (`gh pr create --body` skips it). Ideally 1-2 sentences per field, no AI walkthrough.
- Always open PRs as draft.
- Never apply the `Accept Bundlesize Increase` label.
- **Keep PR descriptions condensed** — usually a few sentences. Explain the _reasoning_: why the change is needed, and any non-obvious decisions or tradeoffs made along the way. Do **not** walk through the implementation or describe what changed file-by-file — the diff already shows that. Only go longer when the decisions genuinely warrant it.

## Architecture
Expand Down
8 changes: 3 additions & 5 deletions dev-packages/size-limit-gh-action/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,14 @@ async function run() {
}

const octokit = getOctokit(githubToken);
let increaseAccepted = false;

if (comparisonBranch) {
const { data: currentPr } = await octokit.rest.pulls.get({
...repo,
pull_number: pr.number,
});
if (currentPr.labels.some(label => label.name === OVERRIDE_LABEL)) {
core.info(`Bundle size increase acknowledged by "${OVERRIDE_LABEL}". Skipping size measurement.`);
return;
}
increaseAccepted = currentPr.labels.some(label => label.name === OVERRIDE_LABEL);
}

const limit = new SizeLimitFormatter();
Expand Down Expand Up @@ -155,7 +153,7 @@ async function run() {
} else if (!base) {
failure = 'No baseline size measurements found. Re-run after the base build completes.';
bodyParts.push(failure);
} else if (increases.length > 0) {
} else if (increases.length > 0 && !increaseAccepted) {
failure =
`One or more gzipped bundles increased by more than ${MAX_INCREASE_BYTES} bytes. ` +
`If this increase is intentional, add the **${OVERRIDE_LABEL}** label to this PR to rerun and accept the check.`;
Expand Down
Loading