From b384bdbe7c2642dcbac4c5ac4e23171ac7a335a5 Mon Sep 17 00:00:00 2001 From: DerSkythe Date: Fri, 31 Mar 2023 07:12:36 +0400 Subject: [PATCH] Change trigger on build firmware and --- .github/check-version.ps1 | 13 +++++++------ .github/workflows/build-with-firmwware.yml | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/check-version.ps1 b/.github/check-version.ps1 index a4e0d9e2208..c2cbefdb558 100644 --- a/.github/check-version.ps1 +++ b/.github/check-version.ps1 @@ -22,10 +22,10 @@ function CleanInput ################################################################################################################################ $Output = @{ - RELEASE_VERSION = '' - CURRENT_TAG = '' - REMOTE_TAG_INFO = '' - RELEASE_TYPE = '' + RELEASE_VERSION = $ReleaseVersion + CURRENT_TAG = $FirmwareVersion + REMOTE_TAG_INFO = $FirmwareVersion + RELEASE_TYPE = 0 } $Release = @(` @@ -75,9 +75,10 @@ elseif ($FirmwareVersionNumber -lt $StoredFirmwareVersionNumber) exit 1 } -$LastPublished = (gh api -H "Accept: application/vnd.github+json" ` +$PublishDates = (gh api -H "Accept: application/vnd.github+json" ` -H "X-GitHub-Api-Version: 2022-11-28" "/repos/$( $RepoSelf )/releases?per_page=1" ` - | ConvertFrom-Json).published_at + | ConvertFrom-Json | Select-Object published_at, created_at) +$LastPublished = ($null -eq $PublishDates.published_at ? $PublishDates.created_at : $PublishDates.published_at) $Delta = ([DateTime]::Now - $LastPublished) $Release = (gh api -H "Accept: application/vnd.github+json" ` diff --git a/.github/workflows/build-with-firmwware.yml b/.github/workflows/build-with-firmwware.yml index 7450ee46f59..cd2cf5c3faf 100644 --- a/.github/workflows/build-with-firmwware.yml +++ b/.github/workflows/build-with-firmwware.yml @@ -9,7 +9,7 @@ on: required: false type: string release: - types: [unpublished] + types: [created] push: paths: - .github/workflows/build-with-firmware.yml