From 8fa4fbd8195b97ce74cf55e6f32560cafb8304a2 Mon Sep 17 00:00:00 2001 From: seth Date: Thu, 11 Jan 2024 15:55:06 -0500 Subject: [PATCH] ci: push branch manually if needed --- .github/workflows/update-lock.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/update-lock.yml b/.github/workflows/update-lock.yml index 117f34f..c018e2c 100644 --- a/.github/workflows/update-lock.yml +++ b/.github/workflows/update-lock.yml @@ -47,13 +47,16 @@ jobs: git commit -am "chore: update nvfetch sources" fi - - name: Create PR + - name: Make PR if needed env: GH_TOKEN: ${{ github.token }} - HEAD_BRANCH: ${{ github.repository_owner }}:${{ steps.branch.outputs.branch }} run: | - gh pr create \ - --base main \ - --head "${{ env.HEAD_BRANCH }}" \ - --title "chore: update lockfiles" \ - --fill + if ! git diff --color=always --exit-code origin/main; then + git push -u origin ${{ steps.branch.outputs.branch }} + + gh pr create \ + --base main \ + --head "${{ steps.branch.outputs.branch }}" \ + --title "chore: update lockfiles" \ + --fill + fi