diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index ff6905d62164..14876ecf6294 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -69,7 +69,7 @@ jobs: github-token: ${{ steps.app-token.outputs.token || github.token }} retries: 3 script: | - require('./ci/github-script/labels.cjs')({ + require('./ci/github-script/labels.js')({ github, context, core, diff --git a/ci/github-script/.editorconfig b/ci/github-script/.editorconfig index 08ca1a194873..67d678ef170c 100644 --- a/ci/github-script/.editorconfig +++ b/ci/github-script/.editorconfig @@ -1,4 +1,3 @@ -# TODO: Move to /.editorconfig, once ci/.editorconfig has made its way through staging. -[*.cjs] +[run] indent_style = space indent_size = 2 diff --git a/ci/github-script/README.md b/ci/github-script/README.md index e71a4f173c57..8ffff0c40922 100644 --- a/ci/github-script/README.md +++ b/ci/github-script/README.md @@ -10,4 +10,4 @@ To run any of the scripts locally: ## Labeler -Run `./run.js labels OWNER REPO`, where OWNER is your username or "NixOS" and REPO the name of your fork or "nixpkgs". +Run `./run labels OWNER REPO`, where OWNER is your username or "NixOS" and REPO the name of your fork or "nixpkgs". diff --git a/ci/github-script/labels.cjs b/ci/github-script/labels.js similarity index 100% rename from ci/github-script/labels.cjs rename to ci/github-script/labels.js diff --git a/ci/github-script/package.json b/ci/github-script/package.json index 906f371f0d5d..4671dd41f0cd 100644 --- a/ci/github-script/package.json +++ b/ci/github-script/package.json @@ -1,6 +1,5 @@ { "private": true, - "type": "module", "dependencies": { "@actions/artifact": "2.3.2", "@actions/github": "6.0.1", diff --git a/ci/github-script/run.js b/ci/github-script/run similarity index 93% rename from ci/github-script/run.js rename to ci/github-script/run index 5127a6a0ee95..1b670a8b2875 100755 --- a/ci/github-script/run.js +++ b/ci/github-script/run @@ -1,4 +1,4 @@ -#!/usr/bin/env node +#!/usr/bin/env -S node --import ./run import { execSync } from 'node:child_process' import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' @@ -48,7 +48,7 @@ program .argument('', 'Owner of the GitHub repository to label (Example: NixOS)') .argument('', 'Name of the GitHub repository to label (Example: nixpkgs)') .action(async (owner, repo) => { - const labels = (await import('./labels.cjs')).default + const labels = (await import('./labels.js')).default run(labels, owner, repo) })