Skip to content

Commit eaf5e57

Browse files
committed
ci: change filter script to ESM format
Because `"type": "module"` was added to `package.json`
1 parent 29bf95e commit eaf5e57

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/workflows/pr-filter.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ jobs:
2121
with:
2222
github-token: ${{ secrets.GITHUB_TOKEN }}
2323
script: |
24-
const script = require('.github/workflows/scripts/pr-filter.js');
25-
await script({ github, context, core });
24+
const { default: filter } = await import('${{ github.workspace }}/.github/workflows/scripts/pr-filter.js');
25+
await filter({ github, context, core });

.github/workflows/scripts/pr-filter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function hasDescription(markdown) {
99
);
1010
}
1111

12-
module.exports = async ({ github, context, core }) => {
12+
export default async ({ github, context, core }) => {
1313
const pr = context.payload.pull_request;
1414
const body = pr.body === null ? '' : pr.body;
1515
const markdown = body.replace(/<!--[\s\S]*?-->/g, '');

0 commit comments

Comments
 (0)