Skip to content

Commit

Permalink
bugfix DevBranch String
Browse files Browse the repository at this point in the history
  • Loading branch information
ITS-Unibas-Choco committed Dec 12, 2024
1 parent dd68e41 commit 8dae50c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion WASP/Private/Compare-JiraState.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function Compare-JiraState () {
.Synopsis
Compare the newest jira state to the jira state log file
.Description
Compare the newest jira state to the jira state log file and create a new list with the differences
Compare the newest jira state to the jira state log file and create a new list with the differences. New issues are not added to the list to compare.
.Notes
FileName: Compare-JiraState.ps1
Author: Tim Keller
Expand Down
12 changes: 5 additions & 7 deletions WASP/Private/Invoke-JiraObserver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function Invoke-JiraObserver {
$merged = $latestPullRequest.Details.merged_at # null, timestamp
$toBranch = $latestPullRequest.Details.base.ref

if (($toBranch -ne "test") -or (($state -ne "open") -and ($null -eq $merged))) {
if (($toBranch -ne $SourceBranch) -or (($state -ne "open") -and ($null -eq $merged))) {
$PullRequestTitle = "$Software to $DestinationName"
New-PullRequest -SourceRepo $packageGalleryRepo -SourceUser $gitHubOrganization -SourceBranch $SourceBranch -DestinationRepo $packageGalleryRepo -DestinationUser $gitHubOrganization -DestinationBranch $DestinationBranch -PullRequestTitle $PullRequestTitle -ErrorAction Stop
Start-Sleep -Seconds 4
Expand All @@ -155,14 +155,12 @@ function Invoke-JiraObserver {
$RemoteBranches,
$DevBranchPrefix
)
$RemoteBranches.GetEnumerator() | foreach {
if ($_.startswith($DevBranchPrefix)) {
return $_
}
else {
return $null
foreach ($branch in $RemoteBranches) {
if ($branch.StartsWith($DevBranchPrefix)) {
return $branch
}
}
return $null
}

# Die verfügbaren Branches werden aus der Package Gallery abgerufen
Expand Down

0 comments on commit 8dae50c

Please sign in to comment.