Skip to content

Commit

Permalink
fix(github): add check for GITHUB_ACTOR for git push (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse authored and relekang committed Jan 17, 2020
1 parent beedccf commit c41e9bb
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions semantic_release/vcs_helpers.py
Expand Up @@ -163,12 +163,22 @@ def push_new_version(
token = auth_token
if config.get('semantic_release', 'hvcs') == 'gitlab':
token = 'gitlab-ci-token:' + token
server = 'https://{token}@{server_url}/{owner}/{name}.git'.format(
token=token,
server_url=domain,
owner=owner,
name=name,
)
actor = os.environ.get('GITHUB_ACTOR')
if actor:
server = 'https://{actor}:{token}@{server_url}/{owner}/{name}.git'.format(
token=token,
server_url=domain,
owner=owner,
name=name,
actor=actor
)
else:
server = 'https://{token}@{server_url}/{owner}/{name}.git'.format(
token=token,
server_url=domain,
owner=owner,
name=name,
)

try:
repo.git.push(server, branch)
Expand Down

0 comments on commit c41e9bb

Please sign in to comment.