File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1+ import { createRequire } from 'module' ;
2+ const require = createRequire ( import . meta. url ) ;
13const fs = require ( 'fs' ) ;
2- const { Octokit } = require ( '@octokit/rest' ) ;
34
4- const octokit = new Octokit ( { auth : process . env . GITHUB_TOKEN } ) ;
5+
56
67const owner = process . env . REPO_OWNER ;
78const repo = process . env . REPO_NAME ;
@@ -18,6 +19,8 @@ const requiredKeys = [
1819] ;
1920
2021async function validateAndMerge ( ) {
22+ const { Octokit } = await import ( '@octokit/rest' ) ;
23+ const octokit = new Octokit ( { auth : process . env . GITHUB_TOKEN } ) ;
2124 try {
2225 const { data : pr } = await octokit . pulls . get ( {
2326 owner,
Original file line number Diff line number Diff line change 2121 PR_NUMBER : ${{ github.event.pull_request.number }}
2222 REPO_OWNER : ${{ github.repository_owner }}
2323 REPO_NAME : ${{ github.event.repository.name }}
24- run : node .github/scripts/validate-and-merge.js
24+ run : node --experimental-modules .github/scripts/validate-and-merge.js
Original file line number Diff line number Diff line change 88 },
99 "author" : " " ,
1010 "license" : " ISC" ,
11+ "type" : " module" ,
1112 "dependencies" : {
1213 "@octokit/rest" : " ^21.0.2"
1314 }
You can’t perform that action at this time.
0 commit comments