fix: configuration object attribute name for secret key (#511) #263
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: Revalidate Production Pages | |
env: | |
CLERK_COM_BASE_URL: https://clerk.com | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- "docs/**" | |
jobs: | |
trigger_revalidate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 10 # Fetch more than just the latest commit so we can accurately compare | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v37 | |
with: | |
files: docs/** | |
json: true | |
- name: Get paths to revalidate | |
id: paths-to-revalidate | |
run: | | |
paths_to_revalidate=$(echo ${{ contains(steps.changed-files.outputs.all_changed_files, 'docs/manifest.json') && '\\\"*\\\"' || toJSON(steps.changed-files.outputs.all_changed_files) }} | sed 's/.mdx//g' | sed 's/\/index//g') | |
echo "paths=$paths_to_revalidate" >> "$GITHUB_OUTPUT" | |
echo "### Paths to revalidate" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "$paths_to_revalidate" >> $GITHUB_STEP_SUMMARY | |
- name: Trigger revalidate | |
if: github.ref_name == 'main' | |
run: | | |
curl -X POST ${{ env.CLERK_COM_BASE_URL }}/api/revalidate-docs \ | |
-H "Content-Type: application/json" \ | |
-H "Authorization: Bearer ${{ secrets.REVALIDATE_DOCS_SECRET }}" \ | |
-d "{\"paths\": ${{ steps.paths-to-revalidate.outputs.paths }}}" |