Skip to content

Commit

Permalink
Always set origin remote url using actor/token
Browse files Browse the repository at this point in the history
  • Loading branch information
aormsby committed Aug 23, 2021
1 parent efedc4c commit aa1ee5d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions run/push_updates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ push_new_commits() {
write_out -1 'Pushing synced data to target branch.'

# TODO: figure out how this would work in local mode...
# update origin url with token since it is not persisted during checkout step when syncing from a private repo
if [ -n "${INPUT_UPSTREAM_REPO_ACCESS_TOKEN}" ]; then
git remote set-url origin "https://${GITHUB_ACTOR}:${INPUT_TARGET_REPO_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
fi
# update origin url with token since it is not necessarily persisted during checkout step
git remote set-url origin "https://${GITHUB_ACTOR}:${INPUT_TARGET_REPO_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"

# shellcheck disable=SC2086
git push ${INPUT_TARGET_PUSH_ARGS} origin "${INPUT_TARGET_SYNC_BRANCH}"
Expand Down

0 comments on commit aa1ee5d

Please sign in to comment.