Skip to content

fix: Add Docker tag validation and remove unused dependency#272

Merged
jaypatrick merged 1 commit intomainfrom
fix/docker-tag-validation
Feb 9, 2026
Merged

fix: Add Docker tag validation and remove unused dependency#272
jaypatrick merged 1 commit intomainfrom
fix/docker-tag-validation

Conversation

@jaypatrick
Copy link
Owner

  • Add version format validation in release workflow to prevent malformed tags
  • Remove @electric-sql/pglite dependency from package.json

Co-Authored-By: Warp agent@warp.dev

- Add version format validation in release workflow to prevent malformed tags
- Remove @electric-sql/pglite dependency from package.json

Co-Authored-By: Warp <agent@warp.dev>
Copilot AI review requested due to automatic review settings February 9, 2026 01:34
@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
adblock-compiler 003c5d3 Feb 09 2026, 01:35 AM

@jaypatrick jaypatrick self-assigned this Feb 9, 2026
@jaypatrick jaypatrick added the bug Something isn't working label Feb 9, 2026
@jaypatrick jaypatrick merged commit b0f96ae into main Feb 9, 2026
16 checks passed
@jaypatrick jaypatrick deleted the fix/docker-tag-validation branch February 9, 2026 01:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens the release pipeline by adding a version-format guard before tagging/pushing Docker images, and it removes an unused npm dependency to reduce the dependency footprint.

Changes:

  • Add release-workflow validation to reject malformed version strings before using them as Docker tags.
  • Remove @electric-sql/pglite from package.json and clean it out of package-lock.json.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
package.json Removes the unused @electric-sql/pglite dependency.
package-lock.json Updates lockfile metadata and removes the @electric-sql/pglite package entry.
.github/workflows/release.yml Adds version parsing + validation before computing Docker image tags.

Comment on lines +137 to +139
# Validate version format (must not start with . and must be semver-like)
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo "Error: Invalid version format '$VERSION'. Must start with a number (e.g., 0.11.6 or 0.11.6-beta.1)" >&2
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new version regex is only a prefix check, so values like 0.11.6/invalid or 0.11.6+build would pass validation but still produce an invalid Docker tag (and can break the release). Consider validating the entire string against Docker tag constraints (and, if desired, full semver), e.g., enforce only [A-Za-z0-9_.-], disallow +, and ensure the whole value matches (use ^...$).

Suggested change
# Validate version format (must not start with . and must be semver-like)
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo "Error: Invalid version format '$VERSION'. Must start with a number (e.g., 0.11.6 or 0.11.6-beta.1)" >&2
# Validate version format:
# - must be semver-like MAJOR.MINOR.PATCH
# - may have an optional pre-release suffix (e.g., -beta.1)
# - must be a valid Docker tag: only [A-Za-z0-9_.-], no '+' or '/'
if [[ ! "$VERSION" =~ ^[0-9]+(\.[0-9]+){2}(-[A-Za-z0-9_.-]+)?$ ]]; then
echo "Error: Invalid version format '$VERSION'. Must be like 0.11.6 or 0.11.6-beta.1 and contain only [A-Za-z0-9_.-]." >&2

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant