Switch to branch and setup remote origin

This commit is contained in:
Stefan Zweifel 2019-08-27 20:26:44 +02:00
parent 6280a31960
commit fdf062fc1c
2 changed files with 7 additions and 0 deletions

View File

@ -52,6 +52,7 @@ New GitHub Actions syntax:
commit_author_name: John Doe
commit_message: Apply automatic changes
env:
TOKEN: ${{ secrets.TOKEN }} # Personal Access Token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

View File

@ -1,6 +1,12 @@
#!/bin/sh
set -eu
# Switch to branch from current Workflow run
git switch "${GITHUB_REF:11}"
# Set origin URL
git remote set-url origin https://$TOKEN:x-oauth-basic@github.com/$GITHUB_REPOSITORY
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"