Skip to content

Standardized in-repo scripts directory - #29410

Merged
acburdine merged 1 commit into
mainfrom
feat/scripts-cleanup
Jul 17, 2026
Merged

acburdine merged 1 commit into
mainfrom
feat/scripts-cleanup

Conversation

@acburdine

Copy link
Copy Markdown
Member

ref https://linear.app/ghost/issue/PLA-235/consolidate-ci-scripts-into-monorepo-package

  • relocate script files from .github/scripts/ to scripts/
  • keep i18n-review in .github/scripts for now due to security/isolation constraints
  • ensure scripts + i18n-review are picked up and tested/linted

@acburdine
acburdine requested a review from 9larsons July 16, 2026 20:43
@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 59ea1aa8-ad1e-480d-bb65-3437a98e7912

📥 Commits

Reviewing files that changed from the base of the PR and between 5e7772b and 5493760.

⛔ Files ignored due to path filters (2)
  • .github/scripts/i18n-review/package-lock.json is excluded by !**/package-lock.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (43)
  • .github/scripts/dependency-inspector.js
  • .github/scripts/i18n-review/README.md
  • .github/scripts/i18n-review/eslint.config.mjs
  • .github/scripts/i18n-review/package.json
  • .github/scripts/i18n-review/src/github.js
  • .github/workflows/ci.yml
  • .github/workflows/devcontainer-build.yml
  • .github/workflows/i18n-review-checks.yml
  • .github/workflows/publish-koenig-package.yml
  • .github/workflows/release.yml
  • .github/workflows/translation-review.yml
  • .pnpmfile.mjs
  • apps/admin-toolbar/package.json
  • apps/admin-x-settings/package.json
  • apps/admin-x-settings/src/utils/link-to-github-releases.ts
  • apps/announcement-bar/package.json
  • apps/comments-ui/package.json
  • apps/portal/package.json
  • apps/signup-form/package.json
  • apps/sodo-search/package.json
  • docker/ghost-dev/Dockerfile
  • eslint.config.mjs
  • ghost/core/package.json
  • koenig/README.md
  • package.json
  • pnpm-workspace.yaml
  • scripts/README.md
  • scripts/build-public-apps-matrix.cjs
  • scripts/check-app-version-bump.cjs
  • scripts/check-migration-integrity.cjs
  • scripts/clean.cjs
  • scripts/compute-next-app-version.cjs
  • scripts/create-package.js
  • scripts/enforce-package-manager.js
  • scripts/eslint.config.mjs
  • scripts/lib/release-notes.cjs
  • scripts/lib/resolve-base-tag.cjs
  • scripts/package.json
  • scripts/public-apps.json
  • scripts/publish-koenig-packages.cjs
  • scripts/release-apps.cjs
  • scripts/release.cjs
  • scripts/test/resolve-base-tag.test.cjs
💤 Files with no reviewable changes (1)
  • .github/scripts/dependency-inspector.js
🚧 Files skipped from review as they are similar to previous changes (36)
  • apps/signup-form/package.json
  • apps/sodo-search/package.json
  • .github/workflows/devcontainer-build.yml
  • apps/comments-ui/package.json
  • scripts/eslint.config.mjs
  • apps/announcement-bar/package.json
  • .github/scripts/i18n-review/eslint.config.mjs
  • scripts/enforce-package-manager.js
  • apps/admin-x-settings/package.json
  • .github/workflows/i18n-review-checks.yml
  • .github/workflows/publish-koenig-package.yml
  • .github/workflows/release.yml
  • eslint.config.mjs
  • .github/scripts/i18n-review/package.json
  • .github/scripts/i18n-review/src/github.js
  • scripts/package.json
  • ghost/core/package.json
  • apps/portal/package.json
  • apps/admin-x-settings/src/utils/link-to-github-releases.ts
  • .github/workflows/translation-review.yml
  • scripts/publish-koenig-packages.cjs
  • scripts/public-apps.json
  • pnpm-workspace.yaml
  • scripts/release.cjs
  • scripts/test/resolve-base-tag.test.cjs
  • scripts/compute-next-app-version.cjs
  • koenig/README.md
  • scripts/release-apps.cjs
  • scripts/lib/release-notes.cjs
  • scripts/clean.cjs
  • scripts/create-package.js
  • .github/scripts/i18n-review/README.md
  • scripts/build-public-apps-matrix.cjs
  • package.json
  • scripts/check-migration-integrity.cjs
  • .github/workflows/ci.yml

Walkthrough

The PR creates an @internal/scripts workspace, adds automation utilities and shared tooling, and updates package-manager, dependency, Docker, and ESLint configuration. CI, release workflows, app shipping commands, and documentation now reference migrated .cjs scripts. It adjusts script-relative paths, adds isolated i18n review lint/test automation using Node.js 24, centralizes semver versions, and removes the dependency-inspector script.

Possibly related PRs

  • TryGhost/Ghost#26760 — Directly overlaps with the release automation modules and their migration from the earlier JavaScript implementations.

Suggested reviewers: 9larsons

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: standardizing scripts under the in-repo scripts directory.
Description check ✅ Passed The description matches the changeset by describing the script relocation, the i18n-review exception, and test/lint coverage.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/scripts-cleanup

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Trivy (0.72.0)

Trivy execution failed: 2026-07-16T21:14:09Z FATAL Fatal error run error: fs scan error: scan error: scan failed: failed analysis: post analysis error: post analysis error: kubernetes scan error: fs filter error: fs filter error: walk error range error: stat scripts/doctor.config.json: no such file or directory: range error: stat scripts/doctor.config.json: no such file or directory


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 5493760

Command Status Duration Result
nx run ghost:test:ci:integration ✅ Succeeded 2m 54s View ↗
nx run-many -t test:unit -p @tryghost/adapter-b... ✅ Succeeded 7m 16s View ↗
nx run ghost:test:integration ✅ Succeeded 3m 5s View ↗
nx run @tryghost/admin:test:acceptance ✅ Succeeded 5m 33s View ↗
nx run ghost-monorepo:lint:boundaries ✅ Succeeded 20s View ↗
nx run ghost:test:legacy ✅ Succeeded 3m 14s View ↗
nx run-many -t lint -p @tryghost/adapter-base-r... ✅ Succeeded 3m 33s View ↗
nx run ghost:test:e2e ✅ Succeeded 2m 46s View ↗
Additional runs (8) ✅ Succeeded ... View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-07-16 21:25:56 UTC

@codecov

codecov Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.21%. Comparing base (88a1a1d) to head (5493760).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #29410      +/-   ##
==========================================
+ Coverage   74.17%   74.21%   +0.04%     
==========================================
  Files        1592     1592              
  Lines      139000   139000              
  Branches    16858    16873      +15     
==========================================
+ Hits       103100   103161      +61     
+ Misses      34881    34789      -92     
- Partials     1019     1050      +31     
Flag Coverage Δ
admin-tests 55.45% <ø> (+0.02%) ⬆️
e2e-tests 76.29% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@acburdine
acburdine force-pushed the feat/scripts-cleanup branch from 338c645 to 5e7772b Compare July 16, 2026 21:08

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/lib/release-notes.cjs`:
- Around line 16-26: Update getCommitLog to use execFileSync instead of
execSync, passing git, the log arguments, format value, and range as separate
arguments rather than interpolating fromTag and toTag into a shell command.
Preserve the existing cwd, encoding, trimming, and failure behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e77b274d-a9b2-43b8-8438-25be920fb1f9

📥 Commits

Reviewing files that changed from the base of the PR and between 338c645 and 5e7772b.

⛔ Files ignored due to path filters (2)
  • .github/scripts/i18n-review/package-lock.json is excluded by !**/package-lock.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (42)
  • .github/scripts/dependency-inspector.js
  • .github/scripts/i18n-review/README.md
  • .github/scripts/i18n-review/eslint.config.mjs
  • .github/scripts/i18n-review/package.json
  • .github/scripts/i18n-review/src/github.js
  • .github/workflows/ci.yml
  • .github/workflows/devcontainer-build.yml
  • .github/workflows/i18n-review-checks.yml
  • .github/workflows/publish-koenig-package.yml
  • .github/workflows/release.yml
  • .github/workflows/translation-review.yml
  • apps/admin-toolbar/package.json
  • apps/admin-x-settings/package.json
  • apps/admin-x-settings/src/utils/link-to-github-releases.ts
  • apps/announcement-bar/package.json
  • apps/comments-ui/package.json
  • apps/portal/package.json
  • apps/signup-form/package.json
  • apps/sodo-search/package.json
  • docker/ghost-dev/Dockerfile
  • eslint.config.mjs
  • ghost/core/package.json
  • koenig/README.md
  • package.json
  • pnpm-workspace.yaml
  • scripts/README.md
  • scripts/build-public-apps-matrix.cjs
  • scripts/check-app-version-bump.cjs
  • scripts/check-migration-integrity.cjs
  • scripts/clean.cjs
  • scripts/compute-next-app-version.cjs
  • scripts/create-package.js
  • scripts/enforce-package-manager.js
  • scripts/eslint.config.mjs
  • scripts/lib/release-notes.cjs
  • scripts/lib/resolve-base-tag.cjs
  • scripts/package.json
  • scripts/public-apps.json
  • scripts/publish-koenig-packages.cjs
  • scripts/release-apps.cjs
  • scripts/release.cjs
  • scripts/test/resolve-base-tag.test.cjs
💤 Files with no reviewable changes (1)
  • .github/scripts/dependency-inspector.js
🚧 Files skipped from review as they are similar to previous changes (33)
  • apps/portal/package.json
  • apps/announcement-bar/package.json
  • apps/comments-ui/package.json
  • .github/scripts/i18n-review/eslint.config.mjs
  • scripts/test/resolve-base-tag.test.cjs
  • apps/sodo-search/package.json
  • scripts/enforce-package-manager.js
  • scripts/public-apps.json
  • scripts/package.json
  • pnpm-workspace.yaml
  • .github/workflows/translation-review.yml
  • scripts/create-package.js
  • .github/workflows/release.yml
  • ghost/core/package.json
  • apps/admin-toolbar/package.json
  • scripts/eslint.config.mjs
  • scripts/publish-koenig-packages.cjs
  • eslint.config.mjs
  • .github/workflows/publish-koenig-package.yml
  • .github/workflows/devcontainer-build.yml
  • docker/ghost-dev/Dockerfile
  • .github/scripts/i18n-review/package.json
  • scripts/release-apps.cjs
  • scripts/lib/resolve-base-tag.cjs
  • scripts/clean.cjs
  • .github/workflows/i18n-review-checks.yml
  • .github/scripts/i18n-review/README.md
  • scripts/compute-next-app-version.cjs
  • scripts/build-public-apps-matrix.cjs
  • scripts/check-migration-integrity.cjs
  • scripts/check-app-version-bump.cjs
  • package.json
  • .github/workflows/ci.yml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/lib/release-notes.cjs`:
- Around line 16-26: Update getCommitLog to use execFileSync instead of
execSync, passing git, the log arguments, format value, and range as separate
arguments rather than interpolating fromTag and toTag into a shell command.
Preserve the existing cwd, encoding, trimming, and failure behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e77b274d-a9b2-43b8-8438-25be920fb1f9

📥 Commits

Reviewing files that changed from the base of the PR and between 338c645 and 5e7772b.

⛔ Files ignored due to path filters (2)
  • .github/scripts/i18n-review/package-lock.json is excluded by !**/package-lock.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (42)
  • .github/scripts/dependency-inspector.js
  • .github/scripts/i18n-review/README.md
  • .github/scripts/i18n-review/eslint.config.mjs
  • .github/scripts/i18n-review/package.json
  • .github/scripts/i18n-review/src/github.js
  • .github/workflows/ci.yml
  • .github/workflows/devcontainer-build.yml
  • .github/workflows/i18n-review-checks.yml
  • .github/workflows/publish-koenig-package.yml
  • .github/workflows/release.yml
  • .github/workflows/translation-review.yml
  • apps/admin-toolbar/package.json
  • apps/admin-x-settings/package.json
  • apps/admin-x-settings/src/utils/link-to-github-releases.ts
  • apps/announcement-bar/package.json
  • apps/comments-ui/package.json
  • apps/portal/package.json
  • apps/signup-form/package.json
  • apps/sodo-search/package.json
  • docker/ghost-dev/Dockerfile
  • eslint.config.mjs
  • ghost/core/package.json
  • koenig/README.md
  • package.json
  • pnpm-workspace.yaml
  • scripts/README.md
  • scripts/build-public-apps-matrix.cjs
  • scripts/check-app-version-bump.cjs
  • scripts/check-migration-integrity.cjs
  • scripts/clean.cjs
  • scripts/compute-next-app-version.cjs
  • scripts/create-package.js
  • scripts/enforce-package-manager.js
  • scripts/eslint.config.mjs
  • scripts/lib/release-notes.cjs
  • scripts/lib/resolve-base-tag.cjs
  • scripts/package.json
  • scripts/public-apps.json
  • scripts/publish-koenig-packages.cjs
  • scripts/release-apps.cjs
  • scripts/release.cjs
  • scripts/test/resolve-base-tag.test.cjs
💤 Files with no reviewable changes (1)
  • .github/scripts/dependency-inspector.js
🚧 Files skipped from review as they are similar to previous changes (33)
  • apps/portal/package.json
  • apps/announcement-bar/package.json
  • apps/comments-ui/package.json
  • .github/scripts/i18n-review/eslint.config.mjs
  • scripts/test/resolve-base-tag.test.cjs
  • apps/sodo-search/package.json
  • scripts/enforce-package-manager.js
  • scripts/public-apps.json
  • scripts/package.json
  • pnpm-workspace.yaml
  • .github/workflows/translation-review.yml
  • scripts/create-package.js
  • .github/workflows/release.yml
  • ghost/core/package.json
  • apps/admin-toolbar/package.json
  • scripts/eslint.config.mjs
  • scripts/publish-koenig-packages.cjs
  • eslint.config.mjs
  • .github/workflows/publish-koenig-package.yml
  • .github/workflows/devcontainer-build.yml
  • docker/ghost-dev/Dockerfile
  • .github/scripts/i18n-review/package.json
  • scripts/release-apps.cjs
  • scripts/lib/resolve-base-tag.cjs
  • scripts/clean.cjs
  • .github/workflows/i18n-review-checks.yml
  • .github/scripts/i18n-review/README.md
  • scripts/compute-next-app-version.cjs
  • scripts/build-public-apps-matrix.cjs
  • scripts/check-migration-integrity.cjs
  • scripts/check-app-version-bump.cjs
  • package.json
  • .github/workflows/ci.yml
🛑 Comments failed to post (1)
scripts/lib/release-notes.cjs (1)

16-26: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Use execFileSync to prevent shell injection and handle special characters.

Constructing a shell command string with unescaped arguments (fromTag, toTag) can lead to command injection or failure if the tag names contain special characters. Using execFileSync is safer because it bypasses the shell and passes arguments directly to the executable.

🔒️ Proposed fix to use execFileSync
-function getCommitLog(fromTag, toTag) {
-    const range = `${fromTag}..${toTag}`;
-    const format = '* %s - %an';
-    const cmd = `git log --no-merges --pretty=tformat:'${format}' ${range}`;
-
-    let log;
-    try {
-        log = execSync(cmd, {cwd: ROOT, encoding: 'utf8'}).trim();
-    } catch {
-        return [];
-    }
+function getCommitLog(fromTag, toTag) {
+    const range = `${fromTag}..${toTag}`;
+    const format = '* %s - %an';
+
+    let log;
+    try {
+        const {execFileSync} = require('node:child_process');
+        log = execFileSync('git', ['log', '--no-merges', `--pretty=tformat:${format}`, range], {cwd: ROOT, encoding: 'utf8'}).trim();
+    } catch {
+        return [];
+    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

function getCommitLog(fromTag, toTag) {
    const range = `${fromTag}..${toTag}`;
    const format = '* %s - %an';

    let log;
    try {
        const {execFileSync} = require('node:child_process');
        log = execFileSync('git', ['log', '--no-merges', `--pretty=tformat:${format}`, range], {cwd: ROOT, encoding: 'utf8'}).trim();
    } catch {
        return [];
    }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/lib/release-notes.cjs` around lines 16 - 26, Update getCommitLog to
use execFileSync instead of execSync, passing git, the log arguments, format
value, and range as separate arguments rather than interpolating fromTag and
toTag into a shell command. Preserve the existing cwd, encoding, trimming, and
failure behavior.

ref https://linear.app/ghost/issue/PLA-235/consolidate-ci-scripts-into-monorepo-package
- relocate script files from .github/scripts/ to scripts/
- keep i18n-review in .github/scripts for now due to security/isolation constraints
- ensure scripts + i18n-review are picked up and tested/linted
@acburdine
acburdine force-pushed the feat/scripts-cleanup branch from 5e7772b to 5493760 Compare July 16, 2026 21:13
@acburdine
acburdine merged commit 9fa9458 into main Jul 17, 2026
51 checks passed
@acburdine
acburdine deleted the feat/scripts-cleanup branch July 17, 2026 00:05
@coderabbitai coderabbitai Bot mentioned this pull request Aug 15, 2026
6 tasks done
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