Add a new `pr-number` input
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.
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 done
@pje I've rebased this again - would you find some time to land this?
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.
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.