Skip to content

Commit

Permalink
Fix building for remote PR
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Apr 9, 2024
1 parent 280af56 commit fd19682
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion extension/BuildPhpExtension/private/Get-ExtensionConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit fd19682

Please sign in to comment.