Skip to content

Commit

Permalink
Merge pull request #165 from KajSzy/feature/strategy-option
Browse files Browse the repository at this point in the history
feat: Add strategy-option parameter
  • Loading branch information
carloscastrojumo authored Nov 21, 2024
2 parents 9fb0af1 + 2bf5623 commit 06648a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/github-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface Inputs {
reviewers: string[]
teamReviewers: string[]
cherryPickBranch?: string
strategyOption?: string
force?: boolean
}

Expand Down
13 changes: 7 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as core from '@actions/core'
import * as io from '@actions/io'
import * as exec from '@actions/exec'
import * as utils from './utils'
import * as github from '@actions/github'
import {Inputs, createPullRequest} from './github-helper'
import {PullRequest} from '@octokit/webhooks-types'
import * as io from '@actions/io'
import { PullRequest } from '@octokit/webhooks-types'
import { Inputs, createPullRequest } from './github-helper'
import * as utils from './utils'

const CHERRYPICK_EMPTY =
'The previous cherry-pick is now empty, possibly due to conflict resolution.'
Expand All @@ -24,7 +24,8 @@ export async function run(): Promise<void> {
assignees: utils.getInputAsArray('assignees'),
reviewers: utils.getInputAsArray('reviewers'),
teamReviewers: utils.getInputAsArray('team-reviewers'),
cherryPickBranch: core.getInput('cherry-pick-branch')
cherryPickBranch: core.getInput('cherry-pick-branch'),
strategyOption: core.getInput('strategy-option')
}

core.info(`Cherry pick into branch ${inputs.branch}!`)
Expand Down Expand Up @@ -71,7 +72,7 @@ export async function run(): Promise<void> {
'-m',
'1',
'--strategy=recursive',
'--strategy-option=theirs',
`--strategy-option=${inputs.strategyOption ?? 'theirs'}`,
`${githubSha}`
])
if (result.exitCode !== 0 && !result.stderr.includes(CHERRYPICK_EMPTY)) {
Expand Down

0 comments on commit 06648a8

Please sign in to comment.