Browse Source

CI improvement: not using the REST API to get PR message

Fix #15091, close #15125
pull/15152/head
ArkadiuszMichalski 6 months ago committed by Don Ho
parent
commit
88193a73f3
  1. 9
      .github/workflows/CI_build.yml

9
.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)

Loading…
Cancel
Save