pull/4386/head
aniket-engg 11 months ago committed by Aniket
parent cc85a7c21b
commit d4e299d4df
  1. 14
      createPRToBeta.ts

@ -6,15 +6,17 @@
import { Octokit } from "octokit" import { Octokit } from "octokit"
async function createPR(prNumber, baseBranch) { async function createPR (prNumber, baseBranch) {
try { try {
const octokit = new Octokit({ const octokit = new Octokit({
auth: process.env.authToken || '' auth: process.env.authToken || ''
}) })
const owner = 'ethereum'
const repo = 'remix-project'
const prData = await octokit.request('GET /repos/{owner}/{repo}/pulls/{pull_number}', { const prData = await octokit.request('GET /repos/{owner}/{repo}/pulls/{pull_number}', {
owner: 'ethereum', owner: owner,
repo: 'remix-project', repo: repo,
pull_number: prNumber, pull_number: prNumber,
headers: { headers: {
'X-GitHub-Api-Version': '2022-11-28' 'X-GitHub-Api-Version': '2022-11-28'
@ -22,8 +24,8 @@ async function createPR(prNumber, baseBranch) {
}) })
const response = await octokit.request('POST /repos/{owner}/{repo}/pulls', { const response = await octokit.request('POST /repos/{owner}/{repo}/pulls', {
owner: 'ethereum', owner: owner,
repo: 'remix-project', repo: repo,
title: prData.data.title + ' (for beta)', title: prData.data.title + ' (for beta)',
body: prData.data.body + ' (for beta)', body: prData.data.body + ' (for beta)',
head: prData.data.head.ref, head: prData.data.head.ref,
@ -34,7 +36,7 @@ async function createPR(prNumber, baseBranch) {
}) })
console.log('Pull Request Created!!! See: ', response.data.html_url) console.log('Pull Request Created!!! See: ', response.data.html_url)
} catch (error) { } catch (error) {
console.error('Error during PR creation: ', error.message) console.error('Error during PR creation: ', error.message)
} }

Loading…
Cancel
Save