add a section on testing flow for getting valid session tokens #3614
Workflow file for this run
This file contains 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: Pull Request Preview | |
env: | |
API_BASE_URL: https://clerk.com | |
PREVIEW_BASE_URL: https://clerk.com | |
on: | |
pull_request: | |
types: [labeled, unlabeled] | |
jobs: | |
pr_preview: | |
if: ${{ github.event.label.name == 'deploy-preview' }} | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
steps: | |
- name: Revalidate PR preview | |
run: | | |
curl -X POST ${{ env.API_BASE_URL }}/docs/revalidate \ | |
-H "Content-Type: application/json" \ | |
-H "Authorization: Bearer ${{ secrets.REVALIDATE_DOCS_SECRET }}" \ | |
-d "{\"tags\": [\"docs:pr:${{ github.event.pull_request.number }}\"]}" | |
- name: Share PR preview URL | |
if: ${{ github.event.action == 'labeled' }} | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: 'Hey, here’s your docs preview: ' + process.env.PREVIEW_BASE_URL + '/docs/pr/' + context.issue.number, | |
}) |