Skip to content

Commit

Permalink
chore: run authed tests only when auth is available
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Mar 4, 2022
1 parent 2603f85 commit 78f4942
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,18 @@ jobs:
run: eas --version

- name: 🧪 EAS authenticated
if: ${{ env.hasAuth }}
if: ${{ env.hasAuth == 'true' }}
run: eas whoami

- name: 🧪 Expo installed
run: expo --version

- name: 🧪 Expo authenticated
if: ${{ env.hasAuth }}
if: ${{ env.hasAuth == 'true' }}
run: expo whoami

preview-comment:
if: ${{ env.hasAuth == 'true' }}
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
Expand All @@ -71,21 +72,23 @@ jobs:
run: expo init -t blank ./temp

- name: 🧪 Without commenting
if: ${{ env.hasAuth == 'true' }}
uses: ./preview-comment
id: preview
with:
project: ./temp
comment: false

- name: 🧪 Output has content
if: ${{ env.hasAuth == 'true' }}
uses: actions/github-script@v5
with:
script: |
const message = `${{ steps.preview.outputs.message }}`
if (!message) throw new Error('Message output is empty')
- name: 🧪 Comment on PR (github-token)
if: ${{ env.hasAuth }}
if: ${{ env.hasAuth == 'true' }}
uses: ./preview-comment
env:
EXPO_TEST_GITHUB_PULL: 149
Expand All @@ -94,7 +97,7 @@ jobs:
channel: test

- name: 🧪 Comment on PR (GITHUB_TOKEN)
if: ${{ env.hasAuth }}
if: ${{ env.hasAuth == 'true' }}
uses: ./preview-comment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 78f4942

Please sign in to comment.