1
- import { exec } from "@actions/exec" ;
1
+ import { exec , getExecOutput } from "@actions/exec" ;
2
2
import * as github from "@actions/github" ;
3
3
import fs from "fs-extra" ;
4
4
import { getPackages , Package } from "@manypkg/get-packages" ;
@@ -7,7 +7,6 @@ import * as semver from "semver";
7
7
import { PreState } from "@changesets/types" ;
8
8
import {
9
9
getChangelogEntry ,
10
- execWithOutput ,
11
10
getChangedPackages ,
12
11
sortTheThings ,
13
12
getVersionsByDirectory ,
@@ -40,14 +39,14 @@ const createRelease = async (
40
39
) ;
41
40
}
42
41
43
- await octokit . repos . createRelease ( {
42
+ await octokit . rest . repos . createRelease ( {
44
43
name : tagName ,
45
44
tag_name : tagName ,
46
45
body : changelogEntry . content ,
47
46
prerelease : pkg . packageJson . version . includes ( "-" ) ,
48
47
...github . context . repo ,
49
48
} ) ;
50
- } catch ( err : any ) {
49
+ } catch ( err ) {
51
50
// if we can't find a changelog, the user has probably disabled changelogs
52
51
if ( err . code !== "ENOENT" ) {
53
52
throw err ;
@@ -82,7 +81,7 @@ export async function runPublish({
82
81
let octokit = github . getOctokit ( githubToken ) ;
83
82
let [ publishCommand , ...publishArgs ] = script . split ( / \s + / ) ;
84
83
85
- let changesetPublishOutput = await execWithOutput (
84
+ let changesetPublishOutput = await getExecOutput (
86
85
publishCommand ,
87
86
publishArgs ,
88
87
{ cwd }
@@ -165,7 +164,7 @@ export async function runPublish({
165
164
const requireChangesetsCliPkgJson = ( cwd : string ) => {
166
165
try {
167
166
return require ( resolveFrom ( cwd , "@changesets/cli/package.json" ) ) ;
168
- } catch ( err : any ) {
167
+ } catch ( err ) {
169
168
if ( err && err . code === "MODULE_NOT_FOUND" ) {
170
169
throw new Error (
171
170
`Have you forgotten to install \`@changesets/cli\` in "${ cwd } "?`
@@ -292,7 +291,7 @@ export async function runVersion({
292
291
}
293
292
294
293
let searchQuery = `repo:${ repo } +state:open+head:${ versionBranch } +base:${ branch } +is:pull-request` ;
295
- let searchResultPromise = octokit . search . issuesAndPullRequests ( {
294
+ let searchResultPromise = octokit . rest . search . issuesAndPullRequests ( {
296
295
q : searchQuery ,
297
296
} ) ;
298
297
let changedPackages = await getChangedPackages ( cwd , versionsByDirectory ) ;
@@ -342,7 +341,7 @@ export async function runVersion({
342
341
343
342
if ( searchResult . data . items . length === 0 ) {
344
343
console . log ( "creating pull request" ) ;
345
- const { data : newPullRequest } = await octokit . pulls . create ( {
344
+ const { data : newPullRequest } = await octokit . rest . pulls . create ( {
346
345
base : branch ,
347
346
head : versionBranch ,
348
347
title : finalPrTitle ,
@@ -357,7 +356,7 @@ export async function runVersion({
357
356
const [ pullRequest ] = searchResult . data . items ;
358
357
359
358
console . log ( `updating found pull request #${ pullRequest . number } ` ) ;
360
- await octokit . pulls . update ( {
359
+ await octokit . rest . pulls . update ( {
361
360
pull_number : pullRequest . number ,
362
361
title : finalPrTitle ,
363
362
body : prBody ,
0 commit comments