-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b08a514
commit 78a48aa
Showing
5 changed files
with
48 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# stdlib | ||
import os | ||
import sys | ||
|
||
# 3rd party | ||
from github3 import GitHub | ||
from github3.repos import Repository | ||
from packaging.version import InvalidVersion, Version | ||
|
||
latest_tag = os.environ["GITHUB_REF_NAME"] | ||
|
||
try: | ||
current_version = Version(latest_tag) | ||
except InvalidVersion: | ||
sys.exit() | ||
|
||
gh: GitHub = GitHub(token=os.environ["GITHUB_TOKEN"]) | ||
repo: Repository = gh.repository(*os.environ["GITHUB_REPOSITORY"].split('/', 1)) | ||
|
||
for milestone in repo.milestones(state="open"): | ||
try: | ||
milestone_version = Version(milestone.title) | ||
except InvalidVersion: | ||
continue | ||
if milestone_version == current_version: | ||
sys.exit(not milestone.update(state="closed")) |
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