-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Bug: CI Workflow 'Bundles - size-limit' runs onmain branch, not PR #6852
Copy link
Copy link
Description
When opening a pull request, a job titled 'Bundles - size-limit' will be executed to calculate the size increase of packages added via the package manager. I believe this is too see any changes to the compiled size introduced via a PR, yet due the nature of pull_request_target by default using the context of the base ref of the PR, it compares main with main.
Lexical version: N/A
Steps To Reproduce
- Open a Pull Request from any branch
- Let the 'Bundles - size-limit' workflow run
- View the
actions/checkout@v4step to check therefdebug log to see its set torefs/head/main
Link to code example:
- Action run of a random PR, showing main as the ref
- PR that edits
package.json, yet size-limit comment shows no size increase
The current behavior
'Bundles - size-limit' checkouts the base of the PR (most of the time main) and compares the built size with main
The expected behavior
'Bundles - size-limit' checkouts the head of the PR and compares the built size with main
Impact of fix
This happens on every pull request. Fixing involves 2 possible solutions:
- Add the
github.pull_request.head_refasreffor the checkout action
- NOTE: This solutions means
npm install&npm run buildis executed on untrusted code when a PR is raised.
- Change to
pull_requestevent trigger, but this workflow will now require approval
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels