Skip to content

Fix CLI Homebrew checksum matcher in publish workflow template#1446

Merged
ChiragAgg5k merged 1 commit intomasterfrom
fix/cli-publish-homebrew-regex
Apr 14, 2026
Merged

Fix CLI Homebrew checksum matcher in publish workflow template#1446
ChiragAgg5k merged 1 commit intomasterfrom
fix/cli-publish-homebrew-regex

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

What does this PR do?

Sync the CLI publish workflow template with the fix already applied in appwrite/sdk-for-cli.

The generated workflow was using a Ruby regex literal with \Q#{artifact}\E when rewriting Homebrew SHA256 entries. That matcher failed in the release job, so the checksum update aborted even though the release assets and npm publish had already completed.

This switches the matcher to Regexp.escape(artifact), which matches the generated formula content correctly.

Test Plan

  • Regenerated the CLI SDK with php example.php cli
  • Verified the rendered workflow in examples/cli/.github/workflows/publish.yml uses Regexp.escape(artifact)
  • Reproduced the checksum rewrite against appwrite/sdk-for-cli and confirmed the substitutions succeed with this pattern

Related

@ChiragAgg5k ChiragAgg5k merged commit f605f90 into master Apr 14, 2026
56 checks passed
@ChiragAgg5k ChiragAgg5k deleted the fix/cli-publish-homebrew-regex branch April 14, 2026 14:53
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 14, 2026

Greptile Summary

Replaces the invalid \Q#{artifact}\E Ruby regex quoting syntax (a Perl/Java idiom that Ruby does not recognize) with Regexp.escape(artifact), which is the correct way to escape a string for interpolation into a Ruby regex. This unblocks the Homebrew checksum update step in the release workflow, which was silently failing and calling abort even after npm publish and asset upload had completed. The fix mirrors the change already merged in appwrite/sdk-for-cli#297.

Confidence Score: 5/5

  • This PR is safe to merge — it's a single-line targeted bug fix with no side effects.
  • The change is a correct, minimal fix to a broken Ruby regex pattern. Regexp.escape is the standard Ruby idiom, the copy-scoped template is not processed by Twig so there are no templating concerns, and the fix has already been validated in the downstream sdk-for-cli repo. No other files are affected.
  • No files require special attention.

Important Files Changed

Filename Overview
templates/cli/.github/workflows/publish.yml Fixes the Ruby regex pattern for Homebrew checksum rewriting: replaces invalid \Q...\E Perl/Java quoting syntax with the correct Ruby Regexp.escape idiom. The change is minimal, correct, and syncs this template with the already-deployed fix in sdk-for-cli.

Reviews (1): Last reviewed commit: "fix: escape CLI Homebrew checksum artifa..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant