ci/github-script: default to commonjs

Since all github-scripts need to be written in commonjs, we now default
to it by not setting package.json. Support from editors for .js files is
slightly better than .cjs. To still allow using module imports in the
test runner script, we trick node into loading the script itself as a
module again via `--import ./run`.

(cherry picked from commit d11eba1e1d)
This commit is contained in:
Wolfgang Walther
2025-07-12 15:56:29 +02:00
committed by github-actions[bot]
parent 3d3afc9d32
commit 6f32a5f04e
6 changed files with 5 additions and 7 deletions

View File

@@ -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,