Skip to content

feat: two step release tag creation [ED-24451]#41

Draft
davseve wants to merge 35 commits into
mainfrom
ED-24451
Draft

feat: two step release tag creation [ED-24451]#41
davseve wants to merge 35 commits into
mainfrom
ED-24451

Conversation

@davseve

@davseve davseve commented Jun 24, 2026

Copy link
Copy Markdown
Member

No description provided.

@davseve davseve requested a review from asafdl June 24, 2026 12:25
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread actions/release-tag-creation/action.yml Outdated
Comment thread actions/release-tag-creation/main.ts Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
@davseve davseve requested a review from Ntnelbaba June 25, 2026 09:28
@wiz-9a149474ff

wiz-9a149474ff Bot commented Jul 5, 2026

Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities 8 Medium 4 Low
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total 8 Medium 4 Low

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

Comment thread actions/release-tag-creation/action.yml Outdated
Comment thread actions/release-tag-creation/main.ts
Comment thread actions/release-tag-creation/main.ts Outdated
Comment thread actions/release-tag-creation/main.ts Outdated
Comment thread actions/release-tag-creation/action.yml Outdated
Comment thread actions/release-tag-creation/action.yml Outdated
Comment thread actions/release-tag-creation/main.ts Outdated
Comment thread actions/release-tag-creation/main.ts Outdated
Comment thread actions/release-tag-creation/main.ts
Comment thread actions/release-tag-creation/main.ts Outdated
Comment thread actions/release-tag-creation/index.ts Outdated
Comment thread actions/release-tag-creation/update-version-files.ts Outdated
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
davseve and others added 10 commits July 8, 2026 17:14
This reverts commit 929fb09.
npm ci requires a package-lock.json in the prefix directory, but when
this action is consumed remotely only the action subdirectory is
fetched — without the monorepo root lockfile.

Ref: ED-24451
Co-authored-by: Cursor <cursoragent@cursor.com>
The action is fetched in isolation (no monorepo root), so the local
workspace package @elementor/editor-github-actions-utils is unavailable
at runtime. Inline the three used functions directly.

Ref: ED-24451
Co-authored-by: Cursor <cursoragent@cursor.com>
main.ts was only exporting run() without calling it, so no outputs
were written. Also add "type": "module" to suppress Node warning.

Ref: ED-24451
Co-authored-by: Cursor <cursoragent@cursor.com>
Node's ESM resolver requires explicit file extensions. Without them,
importing './current-version-validation' fails at runtime.

Ref: ED-24451
Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread actions/release-tag-creation/action.yml Fixed
davseve and others added 2 commits July 8, 2026 21:40
- 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>
Comment thread actions/release-tag-creation/action.yml Fixed
Comment thread actions/release-tag-creation/action.yml Fixed
@davseve davseve requested review from Ntnelbaba and Copilot and removed request for asafdl July 9, 2026 05:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-creation action (validation, tag derivation, version-file updates) plus tests.
  • Adds version-file patching/tag-parsing helpers to @elementor/editor-github-actions-utils with Vitest coverage.
  • Adds a test Turbo 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.

Comment thread actions/release-tag-creation/action.yml Outdated
Comment on lines +45 to +52
- 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"

Comment on lines +11 to +14
"dependencies": {
"@actions/core": "^1.11.1",
"semver": "^7.7.2"
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

True story

Comment thread package.json
Comment on lines 13 to 16
"engines": {
"node": ">=20.6.0",
"node": ">=24.0.0",
"npm": ">=10.0.0"
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Make sure of that

Comment on lines +53 to +71
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;
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See if this is valid as well

Comment on lines +18 to +22
return tagsOutput
.split('\n')
.map((line) => line.split('\t')[1]?.replace('refs/tags/', '').trim())
.filter((tag): tag is string => {
if (!tag || !ALLOWED_PATTERN.test(tag)) return false;
cursoragent and others added 2 commits July 9, 2026 05:21
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>
Comment thread package.json
Comment on lines 13 to 16
"engines": {
"node": ">=20.6.0",
"node": ">=24.0.0",
"npm": ">=10.0.0"
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Make sure of that

Comment on lines +53 to +71
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;
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See if this is valid as well

export function patchPhpVersion(content: string, version: string): string {
return content
.replace(/( \* Version: ).*/g, `$1${version}`)
.replace(/(define\( 'ELEMENTOR_VERSION', ')[^']*'/, `$1${version}'`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We can simply add all the places for all the possible options, this will simply skip if the regex not exists

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

For Pro, it will also need the 2 versions back version value, and without the suffix

Comment thread .github/workflows/pr.yml
- name: Checkout source code
uses: actions/checkout@v4

- name: Install Dependencies

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Make sure it uses the correct node version

const channel = getEnv('INPUT_CHANNEL');
const companionTag = getEnv('INPUT_COMPANION_TAG');

// ── elementor.php ────────────────────────────────────────────────────────

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

if exists or if pro exists

@@ -0,0 +1,93 @@
import { readFileSync, writeFileSync, appendFileSync } from 'node:fs';

function patchPhpVersion(content: string, version: string): string {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I saw this function already 🫨

Comment on lines +11 to +14
"dependencies": {
"@actions/core": "^1.11.1",
"semver": "^7.7.2"
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

True story

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.

5 participants