context: fix pull request ref

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2024-09-27 18:19:01 +02:00
parent 18c8bddca3
commit 958f229292
No known key found for this signature in database
GPG Key ID: ADE44D8C9D44FBE4

View File

@ -45,6 +45,8 @@ export class Context {
} }
if (github.context.sha && !gitRef.startsWith(`refs/pull/`)) { if (github.context.sha && !gitRef.startsWith(`refs/pull/`)) {
gitRef = github.context.sha; gitRef = github.context.sha;
} else if (gitRef.startsWith(`refs/pull/`)) {
gitRef = gitRef.replace(/\/merge$/g, '/head');
} }
return gitRef; return gitRef;
} }