Skip to content

Commit

Permalink
Add master-package script handler
Browse files Browse the repository at this point in the history
  • Loading branch information
tjurtsch committed Dec 28, 2020
1 parent 45056ab commit 5642fc7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Empty file modified master-package.sh
100644 → 100755
Empty file.
24 changes: 24 additions & 0 deletions wait-for-statuses.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import urllib.request
import json
import subprocess
import time
import os

status_url = "https://api.github.com/repos/" \
+ os.environ['GITHUB_REPOSITORY'] \
+ "/actions/runs/" \
+ os.environ['GITHUB_RUN_ID'] \
+ "/jobs"

while(True):
time.sleep(60)
success = True
with urllib.request.urlopen(status_url) as url:
data = json.loads(url.read().decode())
for j in data["jobs"]:
if(j["status"] != "completed" and j["name"] != "master-package"):
success = False
if(success):
break

subprocess.call(os.environ['GITHUB_WORKSPACE'] + "/.github/scripts/master-package.sh")

0 comments on commit 5642fc7

Please sign in to comment.