Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/post-release-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ on:
required: false
type: string
default: ''
core_changelog_ref:
description: 'Git ref for the Core changelog. Empty uses the version tag. Pass main to check main.'
required: false
type: string
default: ''
pro_changelog_ref:
description: 'Git ref for the Pro changelog. Empty uses the Pro version tag. Pass main to check main.'
required: false
type: string
default: ''
skip_wordpress_org:
description: 'Skip wordpress.org SVN/download (use when the tag is not on .org yet)'
required: false
Expand Down Expand Up @@ -39,6 +49,16 @@ on:
required: false
type: string
default: ''
core_changelog_ref:
description: 'Git ref for the Core changelog. Empty uses the version tag. Pass main to check main.'
required: false
type: string
default: ''
pro_changelog_ref:
description: 'Git ref for the Pro changelog. Empty uses the Pro version tag. Pass main to check main.'
required: false
type: string
default: ''
skip_wordpress_org:
description: 'Skip wordpress.org SVN/download (use when the tag is not on .org yet)'
required: false
Expand Down Expand Up @@ -126,6 +146,8 @@ jobs:
with:
core-version: ${{ steps.versions.outputs.core }}
pro-version: ${{ steps.versions.outputs.pro }}
core-changelog-ref: ${{ inputs.core_changelog_ref || steps.versions.outputs.core }}
pro-changelog-ref: ${{ inputs.pro_changelog_ref || steps.versions.outputs.pro }}
github-token: ${{ secrets.MAINTAIN_TOKEN || github.token }}
skip-wordpress-org: ${{ inputs.skip_wordpress_org || false }}
dry-run: ${{ inputs.dry_run || false }}
Expand Down
6 changes: 4 additions & 2 deletions actions/post-release-verify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Checks a published Elementor Core (and optionally Pro) release. This is the API/
## What it checks

1. GitHub release API for `elementor/elementor` (`/releases/tags/{version}`) and, if requested, `elementor/elementor-pro`.
2. Non-empty changelog section for that version on `main` (`changelog.txt`; Core also `readme.txt`). **Skipped for prereleases** (`4.3.0-beta2`, any tag with `-`).
2. Non-empty changelog section for that version on the given git ref (`changelog.txt`; Core also `readme.txt`). The action defaults to `main`. The post-release workflow passes the version tag when its ref input is empty. **Skipped for prereleases** (`4.3.0-beta2`, any tag with `-`).
3. wordpress.org SVN tag `readme.txt`: `Stable tag` and changelog (Core GA only). A 404 is **skipped**, not failed — `.org` can lag GitHub by up to a day.
4. Downloaded zip headers: Core `Version` / `ELEMENTOR_VERSION` / `Stable tag`; Pro `Version`, required Core (must be satisfied by the Core version you passed), recommended Core (warn on mismatch).

Expand All @@ -19,6 +19,8 @@ Changelog prose is dumped on the job summary for a quick human read. The action
| -------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `core-version` | yes | e.g. `4.2.2` |
| `pro-version` | no | Empty = Core-only |
| `core-changelog-ref` | no | Git ref for the Core changelog. Defaults to `main`. |
| `pro-changelog-ref` | no | Git ref for the Pro changelog. Defaults to `main`. |
| `github-token` | yes | `github.token` is enough for public Core. **Pro needs a PAT** with `repo` on `elementor/elementor-pro` (same token used for releases, e.g. `MAINTAIN_TOKEN`). |
| `skip-wordpress-org` | no | Force-skip SVN/download even if the tag exists |
| `dry-run` | no | Write failures to the summary without failing the step |
Expand All @@ -34,7 +36,7 @@ Add a thin workflow in `elementor` / `elementor-pro` that `uses` this repo. `act

In the reusable workflow, `github.event_name` is the **caller's** event (e.g. `workflow_dispatch`). Checkout of this repo is keyed off `github.repository`, not `workflow_call`.

Merge this repo first. Core/Pro callers that pin `@main` will fail until then.
Callers can omit the changelog refs. Once this repo is on `main`, an empty ref checks the version tag, so Core and Pro do not need to pass one. Pass `main` only to keep the old check. Merging a caller that passes `core_changelog_ref` or `pro_changelog_ref` before this repo is on `main` fails the workflow call.

This repo must allow GitHub Actions access from other Elementor repositories (Settings → Actions → General → Access).

Expand Down
10 changes: 9 additions & 1 deletion actions/post-release-verify/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Post-release verify
description: Verify published Core/Pro GitHub releases, changelog on main, wordpress.org, and zip version headers.
description: Verify published Core/Pro GitHub releases, changelog on a git ref, wordpress.org, and zip version headers.

inputs:
core-version:
Expand All @@ -9,6 +9,14 @@ inputs:
description: 'Pro version to verify. Leave empty for Core-only.'
required: false
default: ''
core-changelog-ref:
description: 'Git ref for the Core changelog. Defaults to main. The post-release workflow passes the version tag when this is empty.'
required: false
default: 'main'
pro-changelog-ref:
description: 'Git ref for the Pro changelog. Defaults to main. The post-release workflow passes the version tag when this is empty.'
required: false
default: 'main'
github-token:
description: 'GitHub token. Use a PAT with repo access for private Pro releases.'
required: true
Expand Down
15 changes: 10 additions & 5 deletions actions/post-release-verify/checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ const PRO_REPO = 'elementor-pro' as const;
export type VerifyInputs = {
coreVersion: string;
proVersion: string | null;
coreChangelogRef: string;
proChangelogRef: string;
githubToken: string;
skipWordpressOrg: boolean;
workDir: string;
Expand Down Expand Up @@ -126,9 +128,10 @@ export async function runVerify(

await checkMainChangelog({
id: 'core-changelog-main',
title: 'Changelog on main (Core)',
title: `Changelog on ${inputs.coreChangelogRef} (Core)`,
repo: CORE_REPO,
version: inputs.coreVersion,
ref: inputs.coreChangelogRef,
files: ['changelog.txt', 'readme.txt'],
get: deps.get,
headers: githubRaw,
Expand All @@ -139,9 +142,10 @@ export async function runVerify(
if (inputs.proVersion) {
await checkMainChangelog({
id: 'pro-changelog-main',
title: 'Changelog on main (Pro)',
title: `Changelog on ${inputs.proChangelogRef} (Pro)`,
repo: PRO_REPO,
version: inputs.proVersion,
ref: inputs.proChangelogRef,
files: ['changelog.txt'],
get: deps.get,
headers: githubRaw,
Expand Down Expand Up @@ -335,6 +339,7 @@ async function checkMainChangelog(params: {
title: string;
repo: typeof CORE_REPO | typeof PRO_REPO;
version: string;
ref: string;
files: string[];
get: HttpGet;
headers: Record<string, string>;
Expand All @@ -346,7 +351,7 @@ async function checkMainChangelog(params: {
skipped(
params.id,
params.title,
`Prerelease ${params.version} has no changelog on main`,
`Prerelease ${params.version} has no changelog on ${params.ref}`,
),
);
return;
Expand All @@ -358,7 +363,7 @@ async function checkMainChangelog(params: {
for (const filePath of params.files) {
const content = await requireOk(
params.get,
contentsApiUrl(params.repo, filePath),
contentsApiUrl(params.repo, filePath, params.ref),
{ headers: params.headers },
);
const section = getChangelogSection(content, params.version);
Expand Down Expand Up @@ -389,7 +394,7 @@ async function checkMainChangelog(params: {
passed(
params.id,
params.title,
`Found ${params.version} in ${params.files.join(', ')} on main`,
`Found ${params.version} in ${params.files.join(', ')} on ${params.ref}`,
),
);
} catch (error) {
Expand Down
46 changes: 23 additions & 23 deletions actions/post-release-verify/dist/index.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions actions/post-release-verify/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export async function run() {
}

const proVersion = getStringInput('pro-version');
const coreChangelogRef = getStringInput('core-changelog-ref') || 'main';
const proChangelogRef = getStringInput('pro-changelog-ref') || 'main';
const skipWordpressOrg = getBooleanInput('skip-wordpress-org');
const dryRun = getBooleanInput('dry-run');
const workDir = path.resolve(process.cwd(), 'post-release-artifacts');
Expand All @@ -30,6 +32,8 @@ export async function run() {
{
coreVersion,
proVersion,
coreChangelogRef,
proChangelogRef,
githubToken,
skipWordpressOrg,
workDir,
Expand Down
Loading