Skip to content

Commit 0dbdc0e

Browse files
committed
fix(ci): fetch PR head ref from origin
1 parent 961a63e commit 0dbdc0e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

.github/workflows/pr-size.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ jobs:
139139
const issueNumber = context.payload.pull_request.number;
140140
const baseSha = context.payload.pull_request.base.sha;
141141
const headSha = context.payload.pull_request.head.sha;
142-
const headCloneUrl = context.payload.pull_request.head.repo.clone_url;
143-
const headRef = context.payload.pull_request.head.ref;
144142
const headTrackingRef = `refs/remotes/pr-size/${issueNumber}`;
145143
const managedLabels = JSON.parse(process.env.PR_SIZE_LABELS_JSON ?? "[]");
146144
const managedLabelNames = new Set(managedLabels.map((label) => label.name));
@@ -200,7 +198,7 @@ jobs:
200198
201199
execFileSync(
202200
"git",
203-
["fetch", "--no-tags", headCloneUrl, `+refs/heads/${headRef}:${headTrackingRef}`],
201+
["fetch", "--no-tags", "origin", `+refs/pull/${issueNumber}/head:${headTrackingRef}`],
204202
{
205203
stdio: "inherit",
206204
},

0 commit comments

Comments
 (0)