Fix building for remote PR

This commit is contained in:
Shivam Mathur
2024-04-10 02:15:33 +05:30
parent 280af56dc6
commit fd19682fac
2 changed files with 6 additions and 2 deletions

View File

@@ -51,9 +51,13 @@ Function Get-ExtensionConfig {
Copy-Item $PSScriptRoot\..\config\stubs\$Extension.composer.json composer.json
}
}
$ref = $ExtensionRef
if ($ref -match 'refs/pull/(\d+)/merge') {
$ref = $Matches[1]
}
$config = [PSCustomObject]@{
name = $Extension
ref = $ExtensionRef
ref = $ref
php_version = $PhpVersion
arch = $Arch
ts = $Ts

View File

@@ -23,7 +23,7 @@ function Get-ExtensionSource {
}
if($null -eq $ExtensionRef -or $ExtensionRef -eq '') {
if($env:GITHUB_EVENT_NAME -contains "pull_request") {
$ExtensionRef = $env:GITHUB_HEAD_REF
$ExtensionRef = $env:GITHUB_REF
} elseif($null -ne $env:GITHUB_REF_NAME) {
$ExtensionRef = $env:GITHUB_REF_NAME
} else {