1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-10-20 17:53:45 +00:00

ci: change filter script to ESM format

Because `"type": "module"` was added to `package.json`
This commit is contained in:
Cotes Chung 2025-07-31 03:37:32 +08:00
parent 29bf95e9c7
commit eaf5e57449
No known key found for this signature in database
GPG Key ID: 0D9E54843167A808
2 changed files with 3 additions and 3 deletions

View File

@ -21,5 +21,5 @@ jobs:
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
script: | script: |
const script = require('.github/workflows/scripts/pr-filter.js'); const { default: filter } = await import('${{ github.workspace }}/.github/workflows/scripts/pr-filter.js');
await script({ github, context, core }); await filter({ github, context, core });

View File

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