Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ inputs:
draft:
description: 'Create a draft pull request. It is not possible to change draft status after creation except through the web interface'
default: false
force:
description: 'Force push the changes even if the current branch is referenced by others.'
default: false
outputs:
pull-request-number:
description: 'The pull request number'
Expand Down
5 changes: 3 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ function createPullRequest(inputs) {
// The branch was created or updated
core.startGroup(`Pushing pull request branch to '${branchRemoteName}/${inputs.branch}'`);
yield git.push([
'--force-with-lease',
inputs.force ? '--force' : '--force-with-lease',
branchRemoteName,
`HEAD:refs/heads/${inputs.branch}`
]);
Expand Down Expand Up @@ -1109,7 +1109,8 @@ function run() {
reviewers: utils.getInputAsArray('reviewers'),
teamReviewers: utils.getInputAsArray('team-reviewers'),
milestone: Number(core.getInput('milestone')),
draft: core.getBooleanInput('draft')
draft: core.getBooleanInput('draft'),
force: core.getBooleanInput('force')
};
core.debug(`Inputs: ${(0, util_1.inspect)(inputs)}`);
yield (0, create_pull_request_1.createPullRequest)(inputs);
Expand Down
3 changes: 2 additions & 1 deletion src/create-pull-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface Inputs {
teamReviewers: string[]
milestone: number
draft: boolean
force: boolean
}

export async function createPullRequest(inputs: Inputs): Promise<void> {
Expand Down Expand Up @@ -185,7 +186,7 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
`Pushing pull request branch to '${branchRemoteName}/${inputs.branch}'`
)
await git.push([
'--force-with-lease',
inputs.force ? '--force' : '--force-with-lease',
branchRemoteName,
`HEAD:refs/heads/${inputs.branch}`
])
Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ async function run(): Promise<void> {
reviewers: utils.getInputAsArray('reviewers'),
teamReviewers: utils.getInputAsArray('team-reviewers'),
milestone: Number(core.getInput('milestone')),
draft: core.getBooleanInput('draft')
draft: core.getBooleanInput('draft'),
force: core.getBooleanInput('force')
}
core.debug(`Inputs: ${inspect(inputs)}`)

Expand Down