diff --git a/README.md b/README.md index 23ba55a..e4e5f24 100644 --- a/README.md +++ b/README.md @@ -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 }} ``` diff --git a/entrypoint.sh b/entrypoint.sh index df9287d..073ed4a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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"