Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ability to output candidate releases #1041

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

niieani
Copy link

@niieani niieani commented Oct 5, 2024

For the purposes of releasing, it is useful to just get the information of the packages that are about to be released.
If only: 'list-candidate-releases' is set, only output information about which packages would be released.

It provides releases_pending and paths_to_release as the outputs.

In order to enable this new feature, I've added a new input called only that allows running only the desired functionality ('create-github-releases' | 'list-candidate-releases' | 'update-pull-requests').
It is not a breaking change, and is backwards compatible with the skipGitHubRelease and skipGitHubPullRequest inputs.

@niieani
Copy link
Author

niieani commented Dec 5, 2024

Hi @chingor13! I know you must be busy. Any chance you could have a look at this? I'm open to feedback if you want any changes.
It would be really great if we could land a way to only output releases.

🙇

@le-yams
Copy link

le-yams commented Feb 25, 2025

Hi @niieani ,

I would be interested to also have a list-pull-requests feature for the only parameter.

Something like:

export async function main() {
  ...
  if (inputs.only === 'list-pull-requests') {
    core.debug('Listing pending pull requests');
    outputCandidatePRs(await manifest.buildPullRequests());
  }
  ...
}
...
function outputCandidatePRs(prs: ReleasePullRequest[]) {
  prs = prs.filter(pr => pr !== undefined);
  core.setOutput('prs_pending', prs.length > 0);
  if (prs.length) {
    core.setOutput('pr', prs[0]);
    core.setOutput('prs', JSON.stringify(prs));
  }
}

So in this case the pr and prs output would be of type ReleasePullRequest object instead of PullRequest object.

What do you think about it?
🙇

@niieani
Copy link
Author

niieani commented Feb 26, 2025

Hi @le-yams ! I think that's a good addition, however note that I've been trying to get this merged since October 2024.
I do hope @chingor13 can see this at some point in time, and review / give feedback / merge.
If you want to create a fork+commit your change, I can push it into this PR.

Copy link
Contributor

@chingor13 chingor13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this.

I think I'd prefer a dry-run boolean option to mirror what the CLI does rather than maintaining a list of actions.

@niieani
Copy link
Author

niieani commented Mar 12, 2025

Thank you for taking a look @chingor13.
Made the necessary changes and added PR dry-run too based on @le-yams's suggestion.

@niieani niieani requested a review from chingor13 March 12, 2025 04:57
adds ability to output candidate releases, and candidate PRs without actually releasing or updating PRs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants