Skip to content

Commit

Permalink
CI improvement: not using the REST API to get PR message
Browse files Browse the repository at this point in the history
  • Loading branch information
ArkadiuszMichalski authored and donho committed May 15, 2024
1 parent 8055b56 commit 88193a7
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/CI_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 88193a7

Please sign in to comment.