From 963d91e2963eb3cc702d4cd80caa52729c6fdfe7 Mon Sep 17 00:00:00 2001 From: Michael Daniels Date: Fri, 4 Sep 2026 13:12:33 -0400 Subject: [PATCH] ci/github-script/manual-file-edits: convert to TypeScript (cherry picked from commit 4a7ddd07958562e7d6963e2b788a127114a9fa67) --- .github/workflows/check.yml | 2 +- .github/workflows/test.yml | 1 + ...{manual-file-edits.js => manual-file-edits.ts} | 15 ++++++--------- ci/github-script/run | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) rename ci/github-script/{manual-file-edits.js => manual-file-edits.ts} (90%) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index fd3404f07a3b..3514a6ded307 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -122,7 +122,7 @@ jobs: with: github-token: ${{ steps.app-token.outputs.token || github.token }} script: | - const { default: checkManualFileEdits } = await import('${{ github.workspace }}/trusted/ci/github-script/manual-file-edits.js') + const { default: checkManualFileEdits } = await import('${{ github.workspace }}/trusted/ci/github-script/manual-file-edits.ts') await checkManualFileEdits({ github, context, diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d8ea1194f879..d2e3c0e1bb4c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,6 +84,7 @@ jobs: 'ci/github-script/commits.js', 'ci/github-script/get-pr-commit-details.js', 'ci/github-script/lint-commits.js', + 'ci/github-script/manual-file-edits.ts', 'ci/github-script/merge.js', 'ci/github-script/package.json', 'ci/github-script/package-lock.json', diff --git a/ci/github-script/manual-file-edits.js b/ci/github-script/manual-file-edits.ts similarity index 90% rename from ci/github-script/manual-file-edits.js rename to ci/github-script/manual-file-edits.ts index bac83d1ce6b2..f544071dbb78 100644 --- a/ci/github-script/manual-file-edits.js +++ b/ci/github-script/manual-file-edits.ts @@ -2,21 +2,18 @@ import { getCommitDetailsForPR } from './get-pr-commit-details.js' import { dismissReviews, postReview } from './reviews.js' import { classify } from './supportedBranches.js' -/** - * @param {{ - * github: InstanceType, - * context: typeof import('@actions/github').context, - * core: typeof import('@actions/core'), - * repoPath?: string, - * dry: boolean, - * }} CheckManualFileEditsProps - */ export default async function checkManualFileEdits({ github, context, core, repoPath, dry, +}: { + github: InstanceType + context: typeof import('@actions/github').context + core: typeof import('@actions/core') + repoPath?: string + dry: boolean }) { const reviewKey = 'manual-file-edits' diff --git a/ci/github-script/run b/ci/github-script/run index 1fbdd0c24a65..8852bd1e4063 100755 --- a/ci/github-script/run +++ b/ci/github-script/run @@ -123,7 +123,7 @@ program .argument('', 'Name of the GitHub repository to run on (Example: nixpkgs)') .argument('', 'Number of the Pull Request to run on') .action(async (owner, repo, pr, options) => { - const checkManualFileEdits = (await import('./manual-file-edits.js')).default + const checkManualFileEdits = (await import('./manual-file-edits.ts')).default await run(checkManualFileEdits, owner, repo, pr, options) })