Commit b830082
Use current PR state in analyze workflow (#58411)
Summary:
The Analyze Pull Request workflow validates `context.payload.pull_request`, which is the event snapshot saved when a workflow run was created. Rerunning an old run after the PR description or base branch changes therefore validates stale state and can replace a passing check with an incorrect failure.
Fetch the current pull request through `github.rest.pulls.get` before validating its body and base branch so new runs and reruns behave consistently.
## Changelog:
[INTERNAL]
Pull Request resolved: #58411
Test Plan:
- `git diff --check`
- Parsed `.github/workflows/analyze-pr.yml` with Ruby YAML.
- Executed both embedded `github-script` blocks with a mocked valid live PR and stale invalid event payload; both used the live state and passed.
- Executed both blocks with an invalid live PR and valid stale event payload; both used the live state and failed.
- Full repository formatting could not run locally because Yarn package downloads repeatedly failed through the environment proxy with HTTP 503.
Reviewed By: christophpurrer
Differential Revision: D119215496
Pulled By: Abbondanzo
fbshipit-source-id: 08dfb4272b2f89d221d02665c39df49383a747e01 parent 12e979c commit b830082
1 file changed
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
| |||
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
37 | | - | |
38 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
39 | 50 | | |
40 | 51 | | |
41 | 52 | | |
| |||
0 commit comments