-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Feature: Add an Issue in-develop
labeler and functions to close these issues
#990
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
886dcf9
Working on labeler
Thomas-Boi 3e35603
Add in_develop_labeler
Thomas-Boi 74320bd
Build bot can close issues based on labels
Thomas-Boi 857b1b8
Test mode for build
Thomas-Boi 426e735
Fixed errors in labeler_bot
Thomas-Boi 68fdd19
Update build-bot
Thomas-Boi 39070da
Update .github/scripts/icomoon_build.py
Thomas-Boi 30eba76
Merge branch 'develop' into thomas/feature/inDevelopLabeler
Panquesito7 4dbb3d4
Merge branch 'develop' into thomas/feature/inDevelopLabeler
Thomas-Boi 9c6148f
Merge branch 'develop' into thomas/feature/inDevelopLabeler
amacado 21f3bd7
Remove test url
Thomas-Boi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to remove this comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for spotting that