Skip to content

Commit

Permalink
Separate branch and tag
Browse files Browse the repository at this point in the history
  • Loading branch information
reuben committed Dec 19, 2020
1 parent 239656c commit 81c2a33
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ tasks:
action: "pull_request.${event.action}"
login: ${event.pull_request.user.login}
ref: ${event.pull_request.head.ref}
branch_or_tag: ${event.pull_request.head.ref} # requires no special treatment for PRs
branch: ${event.pull_request.head.ref}
tag: ""
sha: ${event.pull_request.head.sha}
clone_url: ${event.pull_request.head.repo.clone_url}
else:
Expand All @@ -21,10 +22,14 @@ tasks:
else: "push"
login: ${event.pusher.name}
ref: ${event.ref}
branch_or_tag:
branch:
$if: 'event.ref[:11] == "refs/heads/"'
then: ${event.ref[11:]}
else: ""
tag:
$if: 'event.ref[:10] == "refs/tags/"'
then: ${event.ref[10:]}
else: ${event.ref[11:]} # then it's refs/heads/...
else: ""
sha: ${event.after}
clone_url: ${event.repository.clone_url}
in:
Expand Down Expand Up @@ -59,8 +64,8 @@ tasks:
GITHUB_HEAD_USER_EMAIL: ${metadata.github.login}@users.noreply.github.com
GITHUB_EVENT: ${metadata.github.action}
GITHUB_HEAD_REPO_URL: ${metadata.github.clone_url}
GITHUB_HEAD_BRANCH: ${metadata.github.branch_or_tag}
GITHUB_HEAD_TAG: ${metadata.github.branch_or_tag}
GITHUB_HEAD_BRANCH: ${metadata.github.branch}
GITHUB_HEAD_TAG: ${metadata.github.tag}
GITHUB_HEAD_REF: ${metadata.github.ref}
GITHUB_HEAD_SHA: ${metadata.github.sha}

Expand Down

0 comments on commit 81c2a33

Please sign in to comment.