GeezerVison is showing github.com — fix(pr-gate): three-dot diff for owner-gate + hold-gate reruns on lab… · ucloud/ucloud-cli@4254e40
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/pr-gate.yml +9-1Lines changed: 9 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -23,6 +23,10 @@ name: PR Gate |
23 | 23 |
|
24 | 24 | on: |
25 | 25 | pull_request: |
| 26 | + # labeled/unlabeled are REQUIRED so hold-gate re-runs when do-not-merge/hold |
| 27 | + # is added/removed after checks went green — otherwise branch protection keeps |
| 28 | + # seeing the stale green hold-gate and the /hold brake silently fails. |
| 29 | + types: [opened, synchronize, reopened, labeled, unlabeled] |
26 | 30 | merge_group: |
27 | 31 |
|
28 | 32 | permissions: |
|
69 | 73 | GOPROXY: 'https://goproxy.cn,direct' |
70 | 74 | run: | |
71 | 75 | set -euo pipefail |
72 | | - git diff --name-status "$OWNER_GATE_BASE_SHA" "$HEAD_SHA" \ |
| 76 | + # Three-dot diff = the PR's own changes (diff from merge-base to head), |
| 77 | + # matching GitHub's "Files changed". A two-dot "$BASE $HEAD" diff would, |
| 78 | + # when the branch is behind master, also surface unrelated master-side |
| 79 | + # changes and wrongly downgrade a product-autonomous PR to platform. |
| 80 | + git diff --name-status "$OWNER_GATE_BASE_SHA...$HEAD_SHA" \ |
73 | 81 | | go run ./hack/owner-gate |
74 | 82 | - name: Post verdict to PR (sticky comment) |
75 | 83 | env: |
|