labeler icon indicating copy to clipboard operation
labeler copied to clipboard

Add a new `pr-number` input

Open Andarist opened this issue 2 years ago • 2 comments

Motivation

It's useful when a previous step/job in a workflow creates a PR, or in general when the workflow is executed in the context of a different event (could be a repository dispatch or just anything) and when the PR number might come from an arbitrary source.

I had a feature request to add labels input to the https://github.com/changesets/action (this action creates/updates a PR) but I think that it would be much better to achieve this through composition. It seems to me that people who needs it could use the output of my action as input to this one.

Andarist avatar Aug 02 '22 19:08 Andarist

Thanks for your contribution, @Andarist!

This is exactly the kind of PR I love to see:

  • flexible, clear use-case
  • limited in scope
  • has tests
  • updates documentation

Please fix the conflicts in dist/index.js (by regenerating it) and I'm happy to merge.

pje avatar Sep 07 '22 15:09 pje

@pje done

Andarist avatar Sep 07 '22 21:09 Andarist

@pje I've rebased this again - would you find some time to land this?

Andarist avatar Dec 06 '22 18:12 Andarist

I'm pretty sure others will figure out how to run this manually using the gh cli but it would be helpful once merged if there were some future guide/doc on how to trigger with this new parameter? Perhaps something like?

echo '{"pull_request":1234}' | gh workflow run labeler.yaml --json

I came here because I was looking to trigger against PR's that need labels, even adding in the workflow_dispatch trigger so do so. Then I realized this wasn't possible since "PR" is only derived from the context.

shaunofneuron avatar Feb 17 '23 20:02 shaunofneuron

Hello @Andarist! Thank you for your willingness to contribute and improve the action! There is a pull request that was opened before yours, and we are going to accept it. I'm closing it as a duplicate.

MaksimZhukov avatar Jun 28 '23 09:06 MaksimZhukov