ropensci-org / buffy

Editorial bots generator
https://buffy-ropensci.readthedocs.io/en/latest/
MIT License
1 stars 2 forks source link

Responder to change template variable #26

Closed mpadge closed 3 years ago

mpadge commented 3 years ago

@xuanxu The multiple approve commands mean that we've got a new "statsgrade" variable in one of our templates. Would it be possible to add a responder which could change the value of that variable?

maelle commented 3 years ago

and that probably adds the variable if missing? We can't guarantee template integrity yet. :sweat_smile:

mpadge commented 3 years ago

and that probably adds the variable if missing? We can't guarantee template integrity yet. sweat_smile

Yes indeed, as an extension of #14

xuanxu commented 3 years ago

There is already a standard responder to change the value of a variable in the body of the issue, the SetValueResponder. It can be configured to add the variable (appending or prepending) to the issue with the if_missing param.

Sample config:

set_value:
  - statsgrade:
      only: editors
      sample_value: "gold"
      if_missing: append
      heading: "Badge grade" 

With that config the command @reviewer_bot set silver as statsgrade should update or add the value.

mpadge commented 3 years ago

We can close this now, right?

xuanxu commented 3 years ago

Yeah, once the PR is merged GitHub will automatically close this issue