From d6334b4a2571b7b1e367e2f904e653dc5c9e6422 Mon Sep 17 00:00:00 2001 From: Bernie White Date: Thu, 27 Oct 2022 00:42:23 +1000 Subject: [PATCH] Fixes stale task versioning #589 (#590) * Fixes stale task versioning #589 * Fix typo --- .azure-pipelines/azure-pipelines.yaml | 19 ------------------- CHANGELOG.md | 3 +++ pipeline.build.ps1 | 8 ++++++-- tasks/ps-rule-assertV2/powershell.ps1 | 2 +- 4 files changed, 10 insertions(+), 22 deletions(-) diff --git a/.azure-pipelines/azure-pipelines.yaml b/.azure-pipelines/azure-pipelines.yaml index c0735e9..c383120 100644 --- a/.azure-pipelines/azure-pipelines.yaml +++ b/.azure-pipelines/azure-pipelines.yaml @@ -131,22 +131,3 @@ stages: extensionTag: '' extensionName: 'PSRule' extensionVisibility: 'public' - - - job: GitHub - dependsOn: stable_release - pool: - vmImage: $(imageName) - steps: - # Update GitHub release - - task: GitHubRelease@1 - displayName: 'GitHub release' - inputs: - gitHubConnection: 'AzureDevOps-PSRule-pipelines' - repositoryName: '$(Build.Repository.Name)' - action: edit - tag: '$(Build.SourceBranchName)' - releaseNotesSource: inline - releaseNotesInline: 'See [change log](https://github.com/microsoft/PSRule-pipelines/blob/main/CHANGELOG.md)' - assetUploadMode: replace - addChangeLog: false - isPreRelease: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a3af3c..43dc657 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,9 @@ What's changed since v2.5.1: - Bump PSRule to v2.5.3. [#581](https://github.com/microsoft/PSRule-pipelines/pull/581) - See the [change log](https://microsoft.github.io/PSRule/v2/CHANGELOG-v2/#v253) +- Bug fixes: + - Fixed stale task versioning by @BernieWhite. + [#589](https://github.com/microsoft/PSRule-pipelines/issues/589) ## v2.5.1 diff --git a/pipeline.build.ps1 b/pipeline.build.ps1 index cecccdf..e1f9015 100644 --- a/pipeline.build.ps1 +++ b/pipeline.build.ps1 @@ -83,11 +83,15 @@ function UpdateTaskVersion { [String]$Path ) process { - $v = $version.Split('.', [System.StringSplitOptions]::RemoveEmptyEntries); + $v = $Build.Split('.', [System.StringSplitOptions]::RemoveEmptyEntries); Get-ChildItem -Path $Path -Filter task.json -Recurse | ForEach-Object { $filePath = $_.FullName; $taskContent = Get-Content -Raw -Path $filePath | ConvertFrom-Json; - $taskContent.version.patch = $v[2]; + + if ($filePath -like '*V2*') { + $taskContent.version.Minor = $v[1]; + } + $taskContent.version.Patch = $v[2]; $taskContent | ConvertTo-Json -Depth 100 | Set-Content -Path $filePath -Force; } } diff --git a/tasks/ps-rule-assertV2/powershell.ps1 b/tasks/ps-rule-assertV2/powershell.ps1 index 94081ef..2901561 100644 --- a/tasks/ps-rule-assertV2/powershell.ps1 +++ b/tasks/ps-rule-assertV2/powershell.ps1 @@ -272,7 +272,7 @@ Write-Host "[info] Using Conventions: $Conventions"; Write-Host "[info] Using InputType: $InputType"; Write-Host "[info] Using InputPath: $InputPath"; Write-Host "[info] Using Option: $Option"; -Write-Host "[info] Using Option: $Outcome"; +Write-Host "[info] Using Outcome: $Outcome"; Write-Host "[info] Using OutputFormat: $OutputFormat"; Write-Host "[info] Using OutputPath: $OutputPath";