chore: Add revalidate install script workflow#225
chore: Add revalidate install script workflow#225alexcarpenter wants to merge 4 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 508e1e9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughThis pull request introduces two new files: a changeset metadata file containing YAML frontmatter delimiters with no additional content, and a GitHub Actions workflow that listens for pushes to the Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.github/workflows/revalidate-install.yml (2)
15-18: Pass the secret viaenvrather than inline expansion.Interpolating
${{ secrets.INSTALL_REVALIDATE_SECRET }}directly into therun:script embeds the secret value into the rendered shell command. GitHub's recommended pattern is to expose secrets as environment variables so they aren't materialized into the command line (safer againstset -x, process listings, and shell-quoting pitfalls).🔒 Proposed refactor
- name: Revalidate install script cache + env: + INSTALL_REVALIDATE_SECRET: ${{ secrets.INSTALL_REVALIDATE_SECRET }} run: | curl -X POST https://clerk.com/api/revalidate-install \ - -H "Authorization: Bearer ${{ secrets.INSTALL_REVALIDATE_SECRET }}" \ + -H "Authorization: Bearer $INSTALL_REVALIDATE_SECRET" \ --fail --silent --show-error🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/revalidate-install.yml around lines 15 - 18, The run block currently inlines the secret into the curl command; instead expose INSTALL_REVALIDATE_SECRET via the step’s env and reference that env var in the Authorization header to avoid materializing the secret. Update the workflow step that contains the run: block and set env: INSTALL_REVALIDATE_SECRET: ${{ secrets.INSTALL_REVALIDATE_SECRET }}, then change the curl header string in the run script from using the interpolated secret to using the shell env variable (Authorization: Bearer $INSTALL_REVALIDATE_SECRET) so the secret is provided securely at runtime.
16-18: Consider adding retries for transient failures.If
clerk.comresponds with a transient 5xx or network hiccup during the workflow window, the revalidation is silently skipped until the nextinstall.shchange. Adding--retry/--retry-all-errorswould make this more resilient.♻️ Proposed change
curl -X POST https://clerk.com/api/revalidate-install \ -H "Authorization: Bearer $INSTALL_REVALIDATE_SECRET" \ - --fail --silent --show-error + --fail --silent --show-error \ + --retry 3 --retry-all-errors --max-time 30🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/revalidate-install.yml around lines 16 - 18, The curl POST to https://clerk.com/api/revalidate-install currently runs without retries; modify the curl invocation (the command that posts with -H "Authorization: Bearer ${{ secrets.INSTALL_REVALIDATE_SECRET }}" and --fail --silent --show-error) to add retry flags such as --retry 3 --retry-all-errors (optionally with --retry-delay 2) so transient 5xx or network hiccups are retried before giving up.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/revalidate-install.yml:
- Around line 15-18: The run block currently inlines the secret into the curl
command; instead expose INSTALL_REVALIDATE_SECRET via the step’s env and
reference that env var in the Authorization header to avoid materializing the
secret. Update the workflow step that contains the run: block and set env:
INSTALL_REVALIDATE_SECRET: ${{ secrets.INSTALL_REVALIDATE_SECRET }}, then change
the curl header string in the run script from using the interpolated secret to
using the shell env variable (Authorization: Bearer $INSTALL_REVALIDATE_SECRET)
so the secret is provided securely at runtime.
- Around line 16-18: The curl POST to https://clerk.com/api/revalidate-install
currently runs without retries; modify the curl invocation (the command that
posts with -H "Authorization: Bearer ${{ secrets.INSTALL_REVALIDATE_SECRET }}"
and --fail --silent --show-error) to add retry flags such as --retry 3
--retry-all-errors (optionally with --retry-delay 2) so transient 5xx or network
hiccups are retried before giving up.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fde24d5a-7d2c-484d-ac2c-0cf76f3fa377
📒 Files selected for processing (2)
.changeset/silly-files-hear.md.github/workflows/revalidate-install.yml
No description provided.