Skip to content

Commit 126af84

Browse files
committed
fix release notes
1 parent 1d4bfad commit 126af84

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tools/GitHub/Invoke-ListGitHubReleaseNotes.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,17 @@
2929
$Table = Get-CIPPTable -TableName cacheGitHubReleaseNotes
3030
$PartitionKey = 'GitHubReleaseNotes'
3131
$Filter = "PartitionKey eq '$PartitionKey'"
32-
$Rows = Get-CIPPAzDataTableEntity @Table -filter $Filter | Where-Object -Property Timestamp -GT (Get-Date).AddHours(-24)
32+
$Rows = Get-CIPPAzDataTableEntity @Table -filter $Filter
3333

3434
try {
3535
if ($Rows) {
3636
$Releases = ConvertFrom-Json -InputObject $Rows.GitHubReleases -Depth 10
37-
} else {
37+
if ($Releases.releaseTag -notmatch $global:CippVersion) {
38+
$Releases = $null
39+
}
40+
}
41+
42+
if (-not $Releases) {
3843
$Releases = Invoke-GitHubApiRequest -Path $ReleasePath
3944
$Releases = $Releases | ForEach-Object {
4045
[ordered]@{
@@ -48,7 +53,6 @@
4853
commitish = $_.target_commitish
4954
}
5055
}
51-
5256
$Results = @{
5357
GitHubReleases = [string](ConvertTo-Json -Depth 10 -InputObject $Releases)
5458
RowKey = [string]'GitHubReleaseNotes'

0 commit comments

Comments
 (0)