Accessing the current user doesn't work with the GHA token for some reason
Revert back to using the C env var to check if we are in CI.
This commit is contained in:
parent
64b4cd1026
commit
b09ce45381
@ -95,14 +95,11 @@ def download_asset(asset, target_path: str, timeout=15) -> str:
|
||||
|
||||
def upload_asset(type_: str, path: os.PathLike, replace=True):
|
||||
# type_: msys/mingw/failed
|
||||
path = Path(path)
|
||||
gh = Github(*get_credentials())
|
||||
|
||||
current_user = gh.get_user()
|
||||
if current_user.login != "github-actions[bot]" or current_user.type != "Bot":
|
||||
if not environ.get("CI"):
|
||||
print("WARNING: upload skipped, not running in CI")
|
||||
return
|
||||
|
||||
path = Path(path)
|
||||
gh = Github(*get_credentials())
|
||||
repo = gh.get_repo('msys2/msys2-devtools')
|
||||
release = get_release_assets(repo, "staging-" + type_)
|
||||
if replace:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user