-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated files with 'repo_helper'. (#17)
Co-authored-by: repo-helper[bot] <74742576+repo-helper[bot]@users.noreply.github.com>
- Loading branch information
1 parent
a01c59e
commit 2e03df8
Showing
6 changed files
with
50 additions
and
12 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,28 @@ | ||
#!/usr/bin/env python | ||
|
||
# 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
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