diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 415fa3d84..6f7938c1e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,11 +17,18 @@ jobs: MAlonzo: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Check if ${{ env.MAlonzo_branch }} exists + uses: actions/checkout@v4 with: - ref: MAlonzo-code + ref: ${{ env.MAlonzo_branch }} + id: MAlonzo-exists + continue-on-error: true + if: github.ref != 'refs/heads/master' - name: Create branch ${{ env.MAlonzo_branch }} for generated code - if: github.event_name == 'pull_request' && github.event.action == 'opened' + uses: actions/checkout@v4 + with: + ref: MAlonzo-code + if: github.ref != 'refs/heads/master' && steps.MAlonzo-exists.outcome == 'failure' run: | git checkout -b ${{ env.MAlonzo_branch }} origin/MAlonzo-code git push origin ${{ env.MAlonzo_branch }}