From ba245ff6eee2048902f4e0cd96a77264ca882787 Mon Sep 17 00:00:00 2001 From: cdozdil <35529761+cdozdil@users.noreply.github.com> Date: Tue, 21 Jan 2025 14:25:14 +0300 Subject: [PATCH] Update test.yml --- .github/workflows/test.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8933c303..ba6707ba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -142,20 +142,28 @@ jobs: $datetime = Get-Date Write-Output "Datetime: $datetime`n" + $gitVersion = git --version + Write-Output "Git Version: $gitVersion`n" + #--grep=".yml" --invert-grep # Get commit messages excluding .yml file commits $commits = git log --since="1 day ago" --pretty=format:"%h %s (%an)" --abbrev-commit - Write-Output "Commits: $commits`n" + $commits = $commits -split "`n" + # If no commits are found, cancel the workflow - if ([string]::IsNullOrEmpty($commits)) { + if (-not $commits) { Write-Output "No relevant commits in the last 24 hours. Cancelling workflow." exit 0 } + # Join commits into a newline-separated string + $formattedCommits = $commits -join "`n" + Write-Output "Commits: $formattedCommits`n" + # Generate release notes - $releaseNotes = "### Changes in the Last 24 Hours`n`n$commits" + $releaseNotes = "### Changes in the Last 24 Hours`n`n$formattedCommits" Write-Output "$releaseNotes"