From 88193a73f36067eb427148a16aa248a5762805d7 Mon Sep 17 00:00:00 2001 From: ArkadiuszMichalski <2730894+ArkadiuszMichalski@users.noreply.github.com> Date: Sat, 11 May 2024 10:49:11 +0200 Subject: [PATCH] CI improvement: not using the REST API to get PR message Fix #15091, close #15125 --- .github/workflows/CI_build.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/CI_build.yml b/.github/workflows/CI_build.yml index be8ab0608..57cfc2914 100644 --- a/.github/workflows/CI_build.yml +++ b/.github/workflows/CI_build.yml @@ -37,14 +37,7 @@ jobs: $isPush = "${{github.event_name }}" -eq "push" ? $true : $false $isMaster = $isPush -and $${{ github.ref_name == github.event.repository.master_branch }} - if ($isPush) { - $commit_message = (git show -s --format=%B) - } - else { - $last_commit = @(Invoke-RestMethod ${{ github.event.pull_request._links.commits.href }})[0] | Select-Object -Last 1 - $commit_message = $last_commit.commit.message - } - + $commit_message = $isPush ? (git show -s --format=%B) : (git log -1 --no-merges --pretty=%B) $commit_title = ($commit_message -split "[\r\n]+")[0] Write-Output "title=$commit_title" >> $env:GITHUB_OUTPUT $files_modified = @(git diff --name-only HEAD~1)