Merge pull request #457 from crazy-max/fix-github-ref-pr

context: fix pull request ref
This commit is contained in:
CrazyMax 2024-09-30 09:59:24 +02:00 committed by GitHub
commit 38d1dce1ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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;
} }