update naming and docs
This commit is contained in:
parent
1bbb69d9dd
commit
cff1ab2c9e
6 changed files with 33 additions and 26 deletions
|
@ -92,7 +92,7 @@ export async function createOrUpdateBranch(
|
|||
branch: string,
|
||||
branchRemoteName: string,
|
||||
signoff: boolean,
|
||||
filePatterns: string[]
|
||||
addPaths: string[]
|
||||
): Promise<CreateOrUpdateBranchResult> {
|
||||
// Get the working base.
|
||||
// When a ref, it may or may not be the actual base.
|
||||
|
@ -121,14 +121,15 @@ export async function createOrUpdateBranch(
|
|||
// Commit any uncommitted changes
|
||||
if (await git.isDirty(true)) {
|
||||
core.info('Uncommitted changes found. Adding a commit.')
|
||||
for (const filePattern of filePatterns) {
|
||||
await git.exec(['add', filePattern], true)
|
||||
for (const path of addPaths) {
|
||||
await git.exec(['add', path], true)
|
||||
}
|
||||
const params = ['-m', commitMessage]
|
||||
if (signoff) {
|
||||
params.push('--signoff')
|
||||
}
|
||||
await git.commit(params)
|
||||
// Remove uncommitted tracked and untracked changes
|
||||
git.exec(['reset', '--hard'])
|
||||
git.exec(['clean', '-f'])
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import * as utils from './utils'
|
|||
export interface Inputs {
|
||||
token: string
|
||||
path: string
|
||||
addPaths: string[]
|
||||
commitMessage: string
|
||||
committer: string
|
||||
author: string
|
||||
|
@ -29,7 +30,6 @@ export interface Inputs {
|
|||
teamReviewers: string[]
|
||||
milestone: number
|
||||
draft: boolean
|
||||
addPatternArray: string[]
|
||||
}
|
||||
|
||||
export async function createPullRequest(inputs: Inputs): Promise<void> {
|
||||
|
@ -175,7 +175,7 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
|
|||
inputs.branch,
|
||||
branchRemoteName,
|
||||
inputs.signoff,
|
||||
inputs.addPatternArray
|
||||
inputs.addPaths
|
||||
)
|
||||
core.endGroup()
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ async function run(): Promise<void> {
|
|||
const inputs: Inputs = {
|
||||
token: core.getInput('token'),
|
||||
path: core.getInput('path'),
|
||||
addPaths: utils.getInputAsArray('add-paths'),
|
||||
commitMessage: core.getInput('commit-message'),
|
||||
committer: core.getInput('committer'),
|
||||
author: core.getInput('author'),
|
||||
|
@ -24,8 +25,7 @@ async function run(): Promise<void> {
|
|||
reviewers: utils.getInputAsArray('reviewers'),
|
||||
teamReviewers: utils.getInputAsArray('team-reviewers'),
|
||||
milestone: Number(core.getInput('milestone')),
|
||||
draft: core.getInput('draft') === 'true',
|
||||
addPatternArray: utils.getInputAsArray('add-pattern-array')
|
||||
draft: core.getInput('draft') === 'true'
|
||||
}
|
||||
core.debug(`Inputs: ${inspect(inputs)}`)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue