-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
7b06adf
commit 824cc7d
Showing
6 changed files
with
151 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Label Issue In Develop | ||
on: | ||
pull_request: | ||
types: [closed] | ||
jobs: | ||
label: | ||
name: Label Issue In Develop | ||
runs-on: ubuntu-18.04 | ||
if: github.event.pull_request.merged == true | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Python v3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r ./.github/scripts/requirements.txt | ||
- name: Run in_develop_labeler.py | ||
env: | ||
TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BODY: ${{ github.event.pull_request.body }} | ||
run: python ./.github/scripts/in_develop_labeler.py $TOKEN "$BODY" |