Compare commits

...

2 Commits

Author SHA1 Message Date
9d998cbb4c Remove need for repo scoped token 2019-09-20 10:14:51 +09:00
baab1666cc Update README 2019-09-20 09:47:11 +09:00
3 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,6 @@
on: push
on:
repository_dispatch:
types: [test]
name: create-pull-request action testing workflow
jobs:
createPullRequest:
@ -14,7 +16,6 @@ jobs:
uses: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_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

@ -24,7 +24,7 @@ Create one [here](https://github.com/settings/tokens) and pass that as a secret
```yml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v1.1.3
uses: peter-evans/create-pull-request@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
@ -60,7 +60,7 @@ Here is an example that sets all the environment variables.
```yml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v1.1.3
uses: peter-evans/create-pull-request@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}

View File

@ -60,7 +60,7 @@ def set_git_config(git, email, name):
def set_git_remote_url(git, token, github_repository):
git.remote('set-url', 'origin', "https://%s:x-oauth-basic@github.com/%s" % (token, github_repository))
git.remote('set-url', 'origin', "https://x-access-token:%s@github.com/%s" % (token, github_repository))
def commit_changes(git, branch, commit_message):
@ -82,7 +82,6 @@ def process_event(event_name, event_data, repo, branch, base):
# Fetch required environment variables
github_token = os.environ['GITHUB_TOKEN']
github_repository = os.environ['GITHUB_REPOSITORY']
repo_access_token = os.environ['REPO_ACCESS_TOKEN']
# Fetch remaining optional environment variables
commit_message = os.getenv(
'COMMIT_MESSAGE',
@ -99,7 +98,7 @@ def process_event(event_name, event_data, 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, repo_access_token, github_repository)
set_git_remote_url(repo.git, github_token, github_repository)
# Commit the repository changes
print("Committing changes.")