mirror of
https://forgejo.stefka.eu/jiriks74/create-pull-request.git
synced 2025-01-18 16:01:06 +01:00
rename git-token to branch-token
This commit is contained in:
parent
5294a5ed9d
commit
1985abb7f4
5 changed files with 14 additions and 14 deletions
|
@ -11,7 +11,7 @@ import * as utils from './utils'
|
|||
|
||||
export interface Inputs {
|
||||
token: string
|
||||
gitToken: string
|
||||
branchToken: string
|
||||
path: string
|
||||
addPaths: string[]
|
||||
commitMessage: string
|
||||
|
@ -48,7 +48,7 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
|
|||
core.startGroup('Determining the base and head repositories')
|
||||
const baseRemote = gitConfigHelper.getGitRemote()
|
||||
// Init the GitHub clients
|
||||
const ghBranch = new GitHubHelper(baseRemote.hostname, inputs.gitToken)
|
||||
const ghBranch = new GitHubHelper(baseRemote.hostname, inputs.branchToken)
|
||||
const ghPull = new GitHubHelper(baseRemote.hostname, inputs.token)
|
||||
// Determine the head repository; the target for the pull request branch
|
||||
const branchRemoteName = inputs.pushToFork ? 'fork' : 'origin'
|
||||
|
@ -94,7 +94,7 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
|
|||
// Configure auth
|
||||
if (baseRemote.protocol == 'HTTPS') {
|
||||
core.startGroup('Configuring credential for HTTPS authentication')
|
||||
await gitConfigHelper.configureToken(inputs.gitToken)
|
||||
await gitConfigHelper.configureToken(inputs.branchToken)
|
||||
core.endGroup()
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ async function run(): Promise<void> {
|
|||
try {
|
||||
const inputs: Inputs = {
|
||||
token: core.getInput('token'),
|
||||
gitToken: core.getInput('git-token'),
|
||||
branchToken: core.getInput('git-token'),
|
||||
path: core.getInput('path'),
|
||||
addPaths: utils.getInputAsArray('add-paths'),
|
||||
commitMessage: core.getInput('commit-message'),
|
||||
|
@ -36,8 +36,8 @@ async function run(): Promise<void> {
|
|||
if (!inputs.token) {
|
||||
throw new Error(`Input 'token' not supplied. Unable to continue.`)
|
||||
}
|
||||
if (!inputs.gitToken) {
|
||||
inputs.gitToken = inputs.token
|
||||
if (!inputs.branchToken) {
|
||||
inputs.branchToken = inputs.token
|
||||
}
|
||||
if (inputs.bodyPath) {
|
||||
if (!utils.fileExistsSync(inputs.bodyPath)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue