Overnight Caching is different than some users expect #1036
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: expo_preview | |
| on: | |
| issue_comment: | |
| types: [created] | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| publish_expo_update: | |
| runs-on: ubuntu-latest | |
| # Only run if it's a PR and the comment contains /preview | |
| # Heavily lifted from https://github.com/zirkelc/github-actions-workflows | |
| if: github.event.issue.pull_request && contains(github.event.comment.body, '/preview') | |
| steps: | |
| - name: 🏗 Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| # Checkout the repo on the pull | |
| ref: refs/pull/${{ github.event.issue.number }}/head | |
| - name: Publish EAS update | |
| uses: ./.github/actions/expo/update | |
| with: | |
| pull_request: ${{ github.event.issue.number }} | |
| channel: 'xxx-pr-${{ github.event.issue.number }}' | |
| variant: 'preview' | |
| message: '${{ github.event.issue.title }}' | |
| expo_token: ${{ secrets.EXPO_TOKEN }} | |
| sentry_dsn: ${{ secrets.EXPO_PUBLIC_SENTRY_DSN }} | |
| posthog_api_key: ${{ secrets.EXPO_PUBLIC_POSTHOG_API_KEY }} | |
| notification_webhook: '${{ secrets.NOTIFICATION_WEBHOOK }}' | |
| hmac_token: '${{ secrets.HMAC_TOKEN }}' | |
| - name: Add workflow result as comment on PR | |
| uses: actions/github-script@v6 | |
| if: always() | |
| with: | |
| script: | | |
| const name = '${{ github.workflow }}'; | |
| const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'; | |
| const success = '${{ job.status }}' === 'success'; | |
| const body = `${name}: ${success ? 'succeeded ✅' : 'failed ❌'}\n${url}`; | |
| await github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: body | |
| }) |