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 5815161
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ 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:
Expand All @@ -71,21 +71,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 +96,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 5815161

Please sign in to comment.