From cb6ecfa3983a40d00401d6f42967dd68c10eebd8 Mon Sep 17 00:00:00 2001 From: "Chris. Webster" Date: Mon, 5 Aug 2024 11:52:33 -0700 Subject: [PATCH] es modules: update testing workflow clean up step Change the script to use dynamic import of module. Signed-off-by: Chris. Webster --- .github/workflows/build-and-test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 1062196e61..2161b45227 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -125,6 +125,8 @@ jobs: with: github-token: ${{ env.GGG_TOKEN }} script: | - const exports = require(`${process.env.GITHUB_WORKSPACE}/gitgitgadget/build/lib/delete-ci-test-branches.js`) - await exports.deleteBranches(github, process.env.GITHUB_REPOSITORY_OWNER, process.env.GGG_REPOSITORY); + const {pathToFileURL} = await import("node:url"); + const filePath = pathToFileURL(`${process.env.GITHUB_WORKSPACE}/gitgitgadget/build/lib/delete-ci-test-branches.js`); + const {deleteBranches} = await import(filePath); + await deleteBranches(github, process.env.GITHUB_REPOSITORY_OWNER, process.env.GGG_REPOSITORY); if: env.GGG_REPOSITORY