Skip to content

feat: add ability to output candidate releases#1041

Open
niieani wants to merge 2 commits intogoogleapis:mainfrom
niieani:bb/add-only
Open

feat: add ability to output candidate releases#1041
niieani wants to merge 2 commits intogoogleapis:mainfrom
niieani:bb/add-only

Conversation

@niieani
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy link
Copy Markdown
Author

niieani commented May 23, 2025

Sorry to ping you - I was wondering if there's any chance for a merge&release given the code updated based on your review? 🙇 Much appreciated!

@abhisheksr01
Copy link
Copy Markdown

Sorry to ping you - I was wondering if there's any chance for a merge&release given the code updated based on your review? 🙇 Much appreciated!

I am also awating this feature for a while specially listing the release candidates, @chingor13 could you please re-review this PR?

@yafanasiev

This comment was marked as off-topic.

@ferrarimarco
Copy link
Copy Markdown
Contributor

@niieani thanks for this PR. Can you please rebase your branch against the latest main, please?

@niieani
Copy link
Copy Markdown
Author

niieani commented Nov 28, 2025

@ferrarimarco rebased!

@sconix
Copy link
Copy Markdown

sconix commented Feb 10, 2026

This would be really nice addition to this action and would help optimize the deployments, is there still some change this gets merged some day?

@aharshac
Copy link
Copy Markdown

aharshac commented May 5, 2026

Hi @niieani thanks for the dry-run input. This is a really good proposal.
Could you please rebase against the latest main? Thanks.

niieani added 2 commits May 6, 2026 12:15
adds ability to output candidate releases, and candidate PRs without actually releasing or updating PRs
Motivation: branch was rebased onto the current PR base and the action entrypoint must match the dry-run source changes.
What was done: regenerated the checked-in ncc bundle after resolving the rebase conflicts.
Why this resolves it: GitHub Actions executes dist/index.js, so the packaged action now includes the dry-run behavior from src/index.ts.
@niieani
Copy link
Copy Markdown
Author

niieani commented May 6, 2026

Rebased.

@aharshac
Copy link
Copy Markdown

aharshac commented May 6, 2026

@niieani Thanks. How are you testing the dry-run mode?

@chingor13 Could we please get a review? TIA

@niieani
Copy link
Copy Markdown
Author

niieani commented May 6, 2026

run the action from my fork & branch instead of from googleapis/ if you want to try it out

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.

8 participants