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:
parent
29bf95e9c7
commit
eaf5e57449
4
.github/workflows/pr-filter.yml
vendored
4
.github/workflows/pr-filter.yml
vendored
@ -21,5 +21,5 @@ jobs:
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const script = require('.github/workflows/scripts/pr-filter.js');
|
||||
await script({ github, context, core });
|
||||
const { default: filter } = await import('${{ github.workspace }}/.github/workflows/scripts/pr-filter.js');
|
||||
await filter({ github, context, core });
|
||||
|
2
.github/workflows/scripts/pr-filter.js
vendored
2
.github/workflows/scripts/pr-filter.js
vendored
@ -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 body = pr.body === null ? '' : pr.body;
|
||||
const markdown = body.replace(/<!--[\s\S]*?-->/g, '');
|
||||
|
Loading…
x
Reference in New Issue
Block a user