Skip to content

Commit

Permalink
Skip PR creation step when no changes are present to merge
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Nov 12, 2024
1 parent f49fb31 commit 0459d74
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/libtemplate-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.

- name: merge
id: merge
shell: pwsh
run: |
$LibTemplateBranch = & ./azure-pipelines/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated
Expand All @@ -38,12 +39,14 @@ jobs:
if ((git rev-list FETCH_HEAD ^HEAD --count) -eq 0) {
Write-Host "There are no Library.Template updates to merge."
echo "::set-output name=uptodate::true"
exit 0
}
git -c http.extraheader="AUTHORIZATION: bearer $env:GH_TOKEN" push origin -u FETCH_HEAD:refs/heads/auto/libtemplateUpdate
- name: pull request
shell: pwsh
if: success() && steps.merge.outputs.uptodate != 'true'
run: |
# If there is already an active pull request, don't create a new one.
$existingPR = gh pr list -H auto/libtemplateUpdate --json url | ConvertFrom-Json
Expand Down

0 comments on commit 0459d74

Please sign in to comment.