diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 620cab5..2752bd2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,7 +49,6 @@ jobs: message: 'Update Image Version to v1.2.0' token: ${{ secrets.GH_TOKEN }} - test-target-repository: runs-on: ubuntu-latest steps: @@ -84,7 +83,6 @@ jobs: value: v1.0.1 masterBranchName: main commitChange: 'false' - updateFile: 'true' - name: Cat Updated values.yaml run: cat __tests__/fixtures/values.yaml diff --git a/src/action.ts b/src/action.ts index ddae03f..ea14392 100644 --- a/src/action.ts +++ b/src/action.ts @@ -54,8 +54,14 @@ export async function run(options: Options, actions: Actions): Promise { ) } } catch (error) { - actions.setFailed((error as Error).toString()) - return + const msg = (error as Error).toString() + + if (msg.includes('pull request already exists')) { + actions.info("Pull Request already exists") + return + } + + actions.setFailed(`failed to create PR: ${msg}`) } } diff --git a/src/options.ts b/src/options.ts index 0d90cdb..d3d8a89 100644 --- a/src/options.ts +++ b/src/options.ts @@ -225,6 +225,10 @@ export class EnvOptions implements Options { return process.env.MASTER_BRANCH_NAME || '' } + get force(): boolean { + return process.env.FORCE === 'true' + } + get commitChange(): boolean { return process.env.COMMIT_CHANGE === 'true' }