Repository navigation
Commit adc28a0
Accept stacked PR base branches in analyze-pr (#59109)
Summary:
The `analyze_pr` check fails every PR in a stack above the first (example: #58867), since each targets the branch of the PR below it rather than `main` or a `-stable` branch.
- Pass the branch target check when the base branch is the head of another open PR in the repo.
- Other base branches still fail as before, and the parent PR's own check still guards its target.
NOTE: The workflow runs on `pull_request_target` from `main`, so this takes effect only after it lands.
Changelog: [Internal]
Pull Request resolved: #59109
Test Plan:
```
yarn jest .github/workflow-scripts/__tests__/checkBranchTarget-test.js
```
Checked the lookup the workflow makes against GitHub:
```
gh api 'repos/react/react-native/pulls?state=open&head=react:pr58950'
```
✅ Returns #58950, so #58951 (based on `pr58950`) will pass.
ℹ️ A non-PR branch returns no results and still fails.
Reviewed By: christophpurrer
Differential Revision: D125867260
Pulled By: Abbondanzo
fbshipit-source-id: e30b4768525f5c4938e782231b9b9fc435953f421 parent 7439937 commit adc28a0
3 files changed
Lines changed: 58 additions & 2 deletions
File tree
- .github
- workflow-scripts
- __tests__
- workflows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | | - | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | | - | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
47 | 53 | | |
48 | 54 | | |
| 55 | + | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
| |||
0 commit comments