mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
Upgrade @actions/* dependencies (#123)
* Upgrade `@actions/*` dependencies * bumps deps again * add changeset
This commit is contained in:
+8
-9
@@ -1,4 +1,4 @@
|
||||
import { exec } from "@actions/exec";
|
||||
import { exec, getExecOutput } from "@actions/exec";
|
||||
import * as github from "@actions/github";
|
||||
import fs from "fs-extra";
|
||||
import { getPackages, Package } from "@manypkg/get-packages";
|
||||
@@ -7,7 +7,6 @@ import * as semver from "semver";
|
||||
import { PreState } from "@changesets/types";
|
||||
import {
|
||||
getChangelogEntry,
|
||||
execWithOutput,
|
||||
getChangedPackages,
|
||||
sortTheThings,
|
||||
getVersionsByDirectory,
|
||||
@@ -40,14 +39,14 @@ const createRelease = async (
|
||||
);
|
||||
}
|
||||
|
||||
await octokit.repos.createRelease({
|
||||
await octokit.rest.repos.createRelease({
|
||||
name: tagName,
|
||||
tag_name: tagName,
|
||||
body: changelogEntry.content,
|
||||
prerelease: pkg.packageJson.version.includes("-"),
|
||||
...github.context.repo,
|
||||
});
|
||||
} catch (err: any) {
|
||||
} catch (err) {
|
||||
// if we can't find a changelog, the user has probably disabled changelogs
|
||||
if (err.code !== "ENOENT") {
|
||||
throw err;
|
||||
@@ -82,7 +81,7 @@ export async function runPublish({
|
||||
let octokit = github.getOctokit(githubToken);
|
||||
let [publishCommand, ...publishArgs] = script.split(/\s+/);
|
||||
|
||||
let changesetPublishOutput = await execWithOutput(
|
||||
let changesetPublishOutput = await getExecOutput(
|
||||
publishCommand,
|
||||
publishArgs,
|
||||
{ cwd }
|
||||
@@ -165,7 +164,7 @@ export async function runPublish({
|
||||
const requireChangesetsCliPkgJson = (cwd: string) => {
|
||||
try {
|
||||
return require(resolveFrom(cwd, "@changesets/cli/package.json"));
|
||||
} catch (err: any) {
|
||||
} catch (err) {
|
||||
if (err && err.code === "MODULE_NOT_FOUND") {
|
||||
throw new Error(
|
||||
`Have you forgotten to install \`@changesets/cli\` in "${cwd}"?`
|
||||
@@ -292,7 +291,7 @@ export async function runVersion({
|
||||
}
|
||||
|
||||
let searchQuery = `repo:${repo}+state:open+head:${versionBranch}+base:${branch}+is:pull-request`;
|
||||
let searchResultPromise = octokit.search.issuesAndPullRequests({
|
||||
let searchResultPromise = octokit.rest.search.issuesAndPullRequests({
|
||||
q: searchQuery,
|
||||
});
|
||||
let changedPackages = await getChangedPackages(cwd, versionsByDirectory);
|
||||
@@ -342,7 +341,7 @@ export async function runVersion({
|
||||
|
||||
if (searchResult.data.items.length === 0) {
|
||||
console.log("creating pull request");
|
||||
const { data: newPullRequest } = await octokit.pulls.create({
|
||||
const { data: newPullRequest } = await octokit.rest.pulls.create({
|
||||
base: branch,
|
||||
head: versionBranch,
|
||||
title: finalPrTitle,
|
||||
@@ -357,7 +356,7 @@ export async function runVersion({
|
||||
const [pullRequest] = searchResult.data.items;
|
||||
|
||||
console.log(`updating found pull request #${pullRequest.number}`);
|
||||
await octokit.pulls.update({
|
||||
await octokit.rest.pulls.update({
|
||||
pull_number: pullRequest.number,
|
||||
title: finalPrTitle,
|
||||
body: prBody,
|
||||
|
||||
Reference in New Issue
Block a user