ci: restrict purge to run only after pr is merged to main #2
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
on: | |
pull_request: | |
types: | |
- closed | |
branches: | |
- main | |
jobs: | |
purge-cache: | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
name: Purge get.extism.org cache | |
steps: | |
- run: | | |
curl \ | |
-X POST \ | |
-H "Authorization: Bearer ${{ secrets.CF_API_TOKEN }}" \ | |
-d '{"files": ["https://get.extism.org/cli"]}' \ | |
https://api.cloudflare.com/client/v4/zones/743d5e5a7f33a0b3114b3da1782302d4/purge_cache |