ci: tag users on Slack when locking branches
Created by: davejrt
Uses the commit author to get the slack ID from the slack API and tag the user in the message when locking the branch.
TODO:
Testing: I am guessing there is a way to create a user struct with some dummy data and feed that into the function. Not quite sure how that would be accomplished so would happily receive some examples but I'll keep hacking away at this.
Edit(@jhchabran)
To find the Slack user:
- it grabs the commit offending author
- queries Github for the associated handle
- matches it against the handbook
data/team.yml
to find the author work email - query the Slack API with the author's work email to get the user ID
- use that ID to build a
<@USERID>
string that is 100% accurate.
In case this process fails, the work is not interrupted, the resulting message will simply include a warning we can use to see if someone's GitHub account it missing from the list.