Skip to content

Include pull request number in action output #82

@jonrohan

Description

@jonrohan

👋🏻 Hi I would like to have the pull_number in the steps.changesets.outputs.pull_number output from the action step if steps.changesets.outputs.published == "false".

This is so I can have my action also post a status on the pull request after the changesets/action step runs.

action/src/run.ts

Lines 274 to 291 in aacbc22

if (searchResult.data.items.length === 0) {
console.log("creating pull request");
await octokit.pulls.create({
base: branch,
head: versionBranch,
title: finalPrTitle,
body: await prBodyPromise,
...github.context.repo,
});
} else {
octokit.pulls.update({
pull_number: searchResult.data.items[0].number,
title: finalPrTitle,
body: await prBodyPromise,
...github.context.repo,
});
console.log("pull request found");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions