Rename token variable

This commit is contained in:
Peter Evans 2019-08-13 16:54:29 +09:00
parent c3029959a5
commit 964fc3cdf1
2 changed files with 4 additions and 4 deletions

View file

@ -13,7 +13,7 @@ jobs:
- name: Create Pull Request
uses: ./
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
COMMIT_MESSAGE: Add report file
PULL_REQUEST_BODY: This PR is auto-generated by [create-pull-request](https://github.com/peter-evans/create-pull-request).
PULL_REQUEST_BRANCH: test-patches

View file

@ -70,7 +70,7 @@ def create_pull_request(token, repo, head, base, title, body):
def process_event(github_event, repo, branch, base):
# Fetch required environment variables
github_token = os.environ['GITHUB_TOKEN']
repo_access_token = os.environ['REPO_ACCESS_TOKEN']
github_repository = os.environ['GITHUB_REPOSITORY']
# Fetch remaining optional environment variables
commit_message = os.getenv(
@ -88,7 +88,7 @@ def process_event(github_event, repo, branch, base):
# Set git configuration
set_git_config(repo.git, author_email, author_name)
# Update URL for the 'origin' remote
set_git_remote_url(repo.git, github_token, github_repository)
set_git_remote_url(repo.git, repo_access_token, github_repository)
# Commit the repository changes
print("Committing changes.")
@ -98,7 +98,7 @@ def process_event(github_event, repo, branch, base):
# Create the pull request
print("Creating a request to pull %s into %s." % (branch, base))
pull_request = create_pull_request(
github_token,
repo_access_token,
github_repository,
branch,
base,