mirror of
https://forgejo.stefka.eu/jiriks74/create-pull-request.git
synced 2025-01-18 16:01:06 +01:00
Add possibility to alter the target repository
This commit is contained in:
parent
b7064071dc
commit
f092a452c6
6 changed files with 11 additions and 2 deletions
2
dist/index.js
vendored
2
dist/index.js
vendored
|
@ -1027,6 +1027,7 @@ async function run() {
|
|||
const inputs = {
|
||||
token: core.getInput("token"),
|
||||
path: core.getInput("path"),
|
||||
repository: core.getInput("repository"),
|
||||
commitMessage: core.getInput("commit-message"),
|
||||
committer: core.getInput("committer"),
|
||||
author: core.getInput("author"),
|
||||
|
@ -1047,6 +1048,7 @@ async function run() {
|
|||
|
||||
// Set environment variables from inputs.
|
||||
if (inputs.token) process.env.GITHUB_TOKEN = inputs.token;
|
||||
if (inputs.repository) process.env.CPR_REPOSITORY = inputs.repository;
|
||||
if (inputs.path) process.env.CPR_PATH = inputs.path;
|
||||
if (inputs.commitMessage) process.env.CPR_COMMIT_MESSAGE = inputs.commitMessage;
|
||||
if (inputs.committer) process.env.CPR_COMMITTER = inputs.committer;
|
||||
|
|
3
dist/src/create_pull_request.py
vendored
3
dist/src/create_pull_request.py
vendored
|
@ -22,6 +22,7 @@ DEFAULT_BODY = (
|
|||
+ "[create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action"
|
||||
)
|
||||
DEFAULT_BRANCH = "create-pull-request/patch"
|
||||
DEFAULT_REPOSITORY = os.environ["GITHUB_REPOSITORY"]
|
||||
|
||||
|
||||
def get_git_config_value(repo, name):
|
||||
|
@ -94,7 +95,7 @@ def set_committer_author(repo, committer, author):
|
|||
|
||||
# Get required environment variables
|
||||
github_token = os.environ["GITHUB_TOKEN"]
|
||||
github_repository = os.environ["GITHUB_REPOSITORY"]
|
||||
github_repository = os.getenv("CPR_REPOSITORY", DEFAULT_REPOSITORY)
|
||||
# Get environment variables with defaults
|
||||
path = os.getenv("CPR_PATH", os.getcwd())
|
||||
branch = os.getenv("CPR_BRANCH", DEFAULT_BRANCH)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue