Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
- action.yml: move all ${{ expr }} references out of inline shell scripts
into env: vars so they are never interpolated by the shell
- main.ts: replace execSync with interpolated string with spawnSync
and an args array to prevent command injection via INPUT_VERSION
Ref: ED-24451
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
Adds a new “two-step” release tag creation flow by introducing a dedicated GitHub Action and shared utilities for patching version-related files, along with a CI test pipeline to validate the behavior.
Changes:
- Introduces
actions/release-tag-creationaction (validation, tag derivation, version-file updates) plus tests. - Adds version-file patching/tag-parsing helpers to
@elementor/editor-github-actions-utilswith Vitest coverage. - Adds a
testTurbo task and a PR workflow test job; adjusts TS config and Node engine requirements.
Reviewed changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
turbo.json |
Adds a test task to the Turbo pipeline. |
tsconfig.json |
Enables importing .ts extensions (affects module resolution/typecheck). |
packages/editor-github-actions-utils/src/version-files.ts |
Adds helpers for patching version markers and parsing latest tags from ls-remote. |
packages/editor-github-actions-utils/src/version-files.test.ts |
Adds Vitest coverage for the new utils helpers. |
packages/editor-github-actions-utils/src/index.ts |
Re-exports the new version-files module. |
packages/editor-github-actions-utils/package.json |
Adds Vitest scripts/dependency for the utils package tests. |
package.json |
Adds root test script and bumps Node engine requirement. |
package-lock.json |
Updates lockfile for new workspace/package dependencies and version bumps. |
actions/trickle-down-changelog/main.ts |
Tweaks PR message formatting (removes v prefix). |
actions/release-tag-creation/update-version-files.ts |
Implements readme/elementor.php patching + output capture for the action. |
actions/release-tag-creation/package.json |
Adds the new action package manifest and Vitest config. |
actions/release-tag-creation/main.ts |
Implements version input parsing/validation and derives channel/branch/companion tag. |
actions/release-tag-creation/current-version-validation.ts |
Implements “next version” validation based on remote tags. |
actions/release-tag-creation/current-version-validation.test.ts |
Adds unit tests for “next version” validation. |
actions/release-tag-creation/action.yml |
Defines the composite action steps (install, validate, patch, commit, tag). |
.github/workflows/pr.yml |
Adds a dedicated test job to PR checks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Handle version input | ||
| id: handle-version-input | ||
| shell: bash | ||
| env: | ||
| INPUT_VERSION: ${{ inputs.version }} | ||
| ACTION_PATH: ${{ github.action_path }} | ||
| run: node "$ACTION_PATH/main.ts" | ||
|
|
| const tags = lsRemoteOutput | ||
| .split('\n') | ||
| .map((line) => line.split('\t')[1] ?? '') | ||
| .map((ref) => ref.replace(/^refs\/tags\/v?/, '')) | ||
| .filter((tag) => pattern.test(tag)) | ||
| .sort((a, b) => { | ||
| // Semantic version sort: split on dots and numeric pre-release parts | ||
| const toparts = (v: string) => | ||
| v.split(/[.\-]/).map((p) => (isNaN(Number(p)) ? p : Number(p))); | ||
| const ap = toparts(a); | ||
| const bp = toparts(b); | ||
| for (let i = 0; i < Math.max(ap.length, bp.length); i++) { | ||
| const ai = ap[i] ?? 0; | ||
| const bi = bp[i] ?? 0; | ||
| if (ai < bi) return -1; | ||
| if (ai > bi) return 1; | ||
| } | ||
| return 0; | ||
| }); |
There was a problem hiding this comment.
See if this is valid as well
Apply Prettier formatting to release-tag-creation files and version-files utilities. Remove unnecessary regex escape in version-files.ts. Activate Elementor plugin in setup-elementor-env instead of only validating it, fixing the Performance flow CI job where wp-env installs but does not auto-activate plugins. Ref: ED-24451 Co-authored-by: Netanel Baba <Ntnelbaba@users.noreply.github.com>
Latest Elementor from wordpress.org requires WordPress 6.8 minimum. Update the Test Actions workflow to match. Ref: ED-24451 Co-authored-by: Netanel Baba <Ntnelbaba@users.noreply.github.com>
| const tags = lsRemoteOutput | ||
| .split('\n') | ||
| .map((line) => line.split('\t')[1] ?? '') | ||
| .map((ref) => ref.replace(/^refs\/tags\/v?/, '')) | ||
| .filter((tag) => pattern.test(tag)) | ||
| .sort((a, b) => { | ||
| // Semantic version sort: split on dots and numeric pre-release parts | ||
| const toparts = (v: string) => | ||
| v.split(/[.\-]/).map((p) => (isNaN(Number(p)) ? p : Number(p))); | ||
| const ap = toparts(a); | ||
| const bp = toparts(b); | ||
| for (let i = 0; i < Math.max(ap.length, bp.length); i++) { | ||
| const ai = ap[i] ?? 0; | ||
| const bi = bp[i] ?? 0; | ||
| if (ai < bi) return -1; | ||
| if (ai > bi) return 1; | ||
| } | ||
| return 0; | ||
| }); |
There was a problem hiding this comment.
See if this is valid as well
| const channel = getEnv('INPUT_CHANNEL'); | ||
| const companionTag = getEnv('INPUT_COMPANION_TAG'); | ||
|
|
||
| // ── elementor.php ──────────────────────────────────────────────────────── |
There was a problem hiding this comment.
if exists or if pro exists
There was a problem hiding this comment.
We will handle pro in a seperate PR
| @@ -0,0 +1,93 @@ | |||
| import { readFileSync, writeFileSync, appendFileSync } from 'node:fs'; | |||
|
|
|||
| function patchPhpVersion(content: string, version: string): string { | |||
There was a problem hiding this comment.
I saw this function already 🫨
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
No description provided.