Khan / pull-request-comment-trigger

A github action for detecting a "trigger" in a pull request description or comment
207 stars 91 forks source link

Suggestion: pass arguments to workflow #33

Open dpo opened 1 year ago

dpo commented 1 year ago

Thank you for this action! I thought that it should be possible to use the trigger phrase to "pass arguments" to a workflow. For example, the trigger phrase "#runsomething" and the comment "#runsomething arg1 arg2" could make "arg1" and "arg2" available inside the workflow (maybe as env variables). Those could in turn be passed as arguments to scripts.

Would that be of interest? Would that be hard to implement?

shpingalet007 commented 1 year ago

Agree, it could be nice. For example, I want to implement now a trigger to change package.json and package-lock.json version. Some sort of /version set 0.1.2. Maybe there would be some variations of it /version minor +1 /version major +1 /version patch +1.

shpingalet007 commented 1 year ago

Okay, I forked this repository and made this functionality. Pushed a PR #34 if @Khan would like to accept it...

Example

Trigger: /version set **
PR Comment: /version set 9.0
Output: ["9.0"]