Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { createRequire } from 'module';
import fetch from 'node-fetch';
const require = createRequire(import.meta.url);
const fs = require('fs');
const { Octokit } = require('@octokit/rest');

const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN });


const owner = process.env.REPO_OWNER;
const repo = process.env.REPO_NAME;
Expand All @@ -18,6 +20,14 @@ const requiredKeys = [
];

async function validateAndMerge() {
const { Octokit } = await import('@octokit/rest');

const octokit = new Octokit({
auth: process.env.GITHUB_TOKEN,
request: {
fetch: fetch,
},
});
try {
const { data: pr } = await octokit.pulls.get({
owner,
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '18'
- name: Install dependencies
run: npm install
- name: Validate and auto-merge PR
Expand All @@ -21,4 +21,4 @@ jobs:
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}
run: node .github/scripts/validate-and-merge.js
run: node --experimental-modules .github/scripts/validate-and-merge.mjs
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

node_modules
33 changes: 33 additions & 0 deletions node_modules/.yarn-integrity

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions node_modules/@octokit/auth-token/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

284 changes: 284 additions & 0 deletions node_modules/@octokit/auth-token/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading