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 }}