vuejs / core

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
https://vuejs.org/
MIT License
46.94k stars 8.24k forks source link

ci: correct PR number retrieval to fix size-report action #11223

Closed jh-leong closed 3 months ago

jh-leong commented 3 months ago

I noticed that the size report action has not been working recently.

The failure is due to the action using github.event.workflow_run.pull_requests[0].number to read the PR number. However, according to GitHub's security policy (ref: https://github.com/orgs/community/discussions/25220), this approach does not work for PRs from forked repositories as pull_requests can be empty.

To resolve this, I have reverted the method of retrieving the PR number to the previous implementation using artifact.

ferferga commented 3 months ago

@jh-leong I couldn't reproduce what you say. This looks like could be the solution

The artifacts idea is not good either: it can be tampered in the origin.

ferferga commented 3 months ago

This is another approach that we could attempt, imo even better because that way, in runs logs, they're grouped and it's easier to know the general flow of what's happening.

yyx990803 commented 3 months ago

/cc @sxzz