From 236309a1d6720c9ed1bc1ebb4e0cd422635cd61d Mon Sep 17 00:00:00 2001 From: "Sean P. Kelly" Date: Mon, 16 Sep 2024 21:25:56 +0000 Subject: [PATCH] ci: merge erroneous if statements in release workflow --- .github/workflows/release.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e48a6c71..c6d8a796 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -94,10 +94,12 @@ jobs: # Build and packages all the things upload-artifacts: - if: github.repository == 'bottlerocket-os/twoliter' # Let the initial task tell us to not run (currently very blunt) needs: create-release - if: ${{ needs.create-release.outputs.has-releases == 'true' }} + if: >- + ${{ needs.create-release.outputs.has-releases == 'true' + && github.repository == 'bottlerocket-os/twoliter' + }} strategy: fail-fast: false matrix: @@ -151,10 +153,15 @@ jobs: # Mark the Github Releaseā„¢ as a non-draft now that everything has succeeded! publish-release: - if: github.repository == 'bottlerocket-os/twoliter' # Only run after all the other tasks, but it's ok if upload-artifacts was skipped needs: [create-release, upload-artifacts] - if: ${{ always() && needs.create-release.result == 'success' && (needs.upload-artifacts.result == 'skipped' || needs.upload-artifacts.result == 'success') }} + if: >- + ${{ github.repository == 'bottlerocket-os/twoliter' + && always() + && needs.create-release.result == 'success' + && (needs.upload-artifacts.result == 'skipped' + || needs.upload-artifacts.result == 'success') + }} runs-on: ubuntu-latest env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}