Skip to content

Commit cb6ecfa

Browse files
committed
es modules: update testing workflow clean up step
Change the script to use dynamic import of module. Signed-off-by: Chris. Webster <[email protected]>
1 parent fbf9a24 commit cb6ecfa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/build-and-test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ jobs:
125125
with:
126126
github-token: ${{ env.GGG_TOKEN }}
127127
script: |
128-
const exports = require(`${process.env.GITHUB_WORKSPACE}/gitgitgadget/build/lib/delete-ci-test-branches.js`)
129-
await exports.deleteBranches(github, process.env.GITHUB_REPOSITORY_OWNER, process.env.GGG_REPOSITORY);
128+
const {pathToFileURL} = await import("node:url");
129+
const filePath = pathToFileURL(`${process.env.GITHUB_WORKSPACE}/gitgitgadget/build/lib/delete-ci-test-branches.js`);
130+
const {deleteBranches} = await import(filePath);
131+
await deleteBranches(github, process.env.GITHUB_REPOSITORY_OWNER, process.env.GGG_REPOSITORY);
130132
if: env.GGG_REPOSITORY

0 commit comments

Comments
 (0)