Skip to content

Commit

Permalink
Bug 1539610 [wpt PR 16076] - Log GH event when tagging master, a=test…
Browse files Browse the repository at this point in the history
…only

Automatic update from web-platform-tests
Log GH event when tagging master (#16076)

--

wpt-commits: a960bbaf56c87d3239ec2d6476282110584079da
wpt-pr: 16076

UltraBlame original commit: 8879e7c9fbd007093cae6d7c4d9014760648ab40
  • Loading branch information
marco-c committed Oct 4, 2019
1 parent e9d1351 commit 2d949a2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions testing/web-platform/tests/tools/ci/tag_master.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,21 @@ def create_release(owner, repo, sha, tag, summary, body):
def should_run_action():
with open(os.environ["GITHUB_EVENT_PATH"]) as f:
event = json.load(f)
logger.info(json.dumps(event, indent=2))

if "pull_request" in event:
logger.info("Not tagging for PR")
return False
if event.get("ref") != "refs/heads/master":
logger.info("Not tagging for non-master branch")
logger.info("Not tagging for ref %s" % event.get("ref"))
return False
return True


def main():
repo_key = "GITHUB_REPOSITORY"
should_run = should_run_action()

if not should_run:
logger.info("Not tagging master for this push")
if not should_run_action():
return

owner, repo = os.environ[repo_key].split("/", 1)
Expand Down

0 comments on commit 2d949a2

Please sign in to comment.