Skip to content

Commit

Permalink
Limit release tasks to when secrets are available
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoref committed Jun 13, 2023
1 parent 84b91eb commit 127d3b6
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ on:
- master

jobs:
secrets:
runs-on: ubuntu-latest
outputs:
secrets: ${{ steps.secrets.outputs.secrets }}
steps:
- name: secrets
id: secrets
env:
HAS_PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE != '' }}
HAS_ENCRYPTION_PASSWORD: ${{ secrets.ENCRYPTION_PASSWORD != '' }}
shell: bash
if: env.HAS_PGP_PASSPHRASE == 'true' && env.HAS_ENCRYPTION_PASSWORD == 'true'
run: echo ::set-output name=secrets::true
build:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -80,11 +93,12 @@ jobs:
./build/build.sh ${{ matrix.module }}
release:
if: ${{ github.event_name != 'pull_request' }}
if: ${{github.event_name != 'pull_request' && needs.secrets.outputs.secrets }}
runs-on: ubuntu-latest

needs:
- build
- secrets

strategy:
fail-fast: false
Expand Down Expand Up @@ -148,10 +162,12 @@ jobs:
SCALA_VERSION: ${{ matrix.scala }}

publish:
if: ${{github.event_name != 'pull_request'}}
if: ${{github.event_name != 'pull_request' && needs.secrets.outputs.secrets }}
runs-on: ubuntu-latest

needs: release
needs:
- build
- secrets

strategy:
fail-fast: false
Expand Down

0 comments on commit 127d3b6

Please sign in to comment.