Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Suggestion: pass arguments to workflow #33

Open
dpo opened this issue Sep 26, 2022 · 2 comments
Open

Suggestion: pass arguments to workflow #33

dpo opened this issue Sep 26, 2022 · 2 comments

Comments

@dpo
Copy link

dpo commented Sep 26, 2022

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

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

shpingalet007 commented Oct 4, 2022

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

  • Described ** as a marker of argument. Can include any characters except spaces as it is considered as separator.
  • Added allow_arguments input to the action. If not set to true, it wouldn't parse arguments, and it will expect to see ** "as-is" if there is any in the trigger.
  • Outputting to the steps.check.outputs.arguments as Array.

Example

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants