mirror of
https://github.com/konpa/devicon.git
synced 2025-08-22 22:24:43 +02:00
New Feature: Add an Issue in-develop
labeler and functions to close these issues (#990)
* Working on labeler * Add in_develop_labeler * Build bot can close issues based on labels * Test mode for build * Fixed errors in labeler_bot * Update build-bot * Update .github/scripts/icomoon_build.py Co-authored-by: David Leal <halfpacho@gmail.com> * Remove test url Co-authored-by: David Leal <halfpacho@gmail.com> Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>
This commit is contained in:
20
.github/scripts/in_develop_labeler.py
vendored
Normal file
20
.github/scripts/in_develop_labeler.py
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import re
|
||||
from build_assets import arg_getters, api_handler
|
||||
|
||||
def main():
|
||||
args = arg_getters.get_in_develop_labeler_args()
|
||||
try:
|
||||
# find the issue closing line
|
||||
issue_line = [line for line in args.body.split("\n") if line.startswith("**This PR closes")][0]
|
||||
|
||||
print("Issue Line is " + issue_line)
|
||||
issue_pattern = re.compile(r"\d+")
|
||||
issues_numbers = issue_pattern.findall(issue_line)
|
||||
print("Labelling issues: " + str(issues_numbers))
|
||||
api_handler.label_issues(args.token, issues_numbers, ["in-develop"])
|
||||
except IndexError: # if can't find the issue line
|
||||
print("The PR body doesn't contain `**This PR closes` keywords. Ending workflow.")
|
||||
return
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Reference in New Issue
Block a user