Skip to content

Commit

Permalink
check token before run
Browse files Browse the repository at this point in the history
  • Loading branch information
neil committed Aug 29, 2020
1 parent 70366a9 commit faaa7bf
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/LetsEncrypt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,23 @@ on:


jobs:
CheckToken:
runs-on: ubuntu-latest
outputs:
hasToken: ${{ steps.step_one.outputs.hasToken }}
env:
NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
steps:
- name: Set the value
id: step_one
run: [ "$NGROK_TOKEN" ] && echo "::set-output name=hasToken::true" || echo "::set-output name=hasToken::false"
- name: Check the value
run: echo ${{ steps.step_one.outputs.hasToken }}

Ubuntu:
runs-on: ubuntu-latest
if: "contains(secrets.NGROK_TOKEN, '-')"
needs: CheckToken
if: "contains(needs.CheckToken.outputs.hasToken, 'true')"
env:
NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
TEST_LOCAL: 1
Expand All @@ -30,7 +44,6 @@ jobs:

MacOS:
runs-on: macos-latest
if: "contains(secrets.NGROK_TOKEN, '-')"
needs: Ubuntu
env:
NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
Expand All @@ -46,7 +59,6 @@ jobs:

Windows:
runs-on: windows-latest
if: "contains(secrets.NGROK_TOKEN, '-')"
needs: MacOS
env:
NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
Expand Down

0 comments on commit faaa7bf

Please sign in to comment.