Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.github/workflows: don't clear Cloudflare cache unless configured
The recent change in 0d22411 (.github/workflows: purge Cloudflare cache on deployment, 2024-10-01) will cause deployment workflows run in forks of git/git-scm.com to fail, since they will likely not have a Cloudflare token configured in their repository secrets. Let's make use of a suggestion from Johannes[1] and only run this step when the repository is configured with a Cloudflare token. Note that we can't directly write: if: ${{ secrets.CLOUDFLARE_TOKEN != '' }} , because repository secrets cannot be used in job step-level conditionals[2]. Instead, the GitHub Actions documentation recommends setting the secret as an environment variable, and then using the presence (or absence) of that environment variable's contents as a proxy to determine whether or not the secret is set. All together, this should un-break deployment workflows in forks of git/git-scm.com for repositories that have not set up a Cloudflare token. [1]: #1893 (review) [2]: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-using-secrets Suggested-by: Johannes Schindelin <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
- Loading branch information