fjogeleit / yaml-update-action

Update YAML property with dynamic values
MIT License
143 stars 45 forks source link

Job reports as "Failed" if PR already exists #554

Closed Mitchell-Eaton closed 8 months ago

Mitchell-Eaton commented 10 months ago

Using this action with

...
          commitChange: true
          branch: mergeThisToUpdateDev
          createPR: 'true'
...

"Fails" if the PR already exists:

HttpError: Validation Failed: 
{"resource":"PullRequest","code":"custom","message":
"A pull request already exists for foo:mergeThisToUpdateDev."}

However, the job is doing exactly what I'd expect, updating the yaml file and committing the new change to the branch after each run. image

In my use case, "createPR" would work best if it didn't report failure on the PR already existing (or if there was an additional option for that). The end-state is still such that a PR exists.

fjogeleit commented 8 months ago

Sorry for the late response, I’ll take a look but it can take a bit.

deleze commented 8 months ago

I have the same issue.

fjogeleit commented 8 months ago

I merged a change which should only add an info logging if a PR already exists. Its available in main. Could you confirm that it solves your issue? Then I create a release for it.

Mitchell-Eaton commented 8 months ago

Just now, Jan 30, my GHA still "failed".

Run fjogeleit/yaml-update-action@main
  with:
    commitChange: true
    branch: mergeThisToUpdateDev
    createPR: true
    message: Update Dev Image Version to 0.1.62
    changes: {
    "helm/dev-values.yaml": {
      "image.tag": "0.1.62"
    }
  }

HttpError: Validation Failed: {"resource":"PullRequest","code":"custom","message":"A pull request already exists for foo:mergeThisToUpdateDev."}

fjogeleit commented 8 months ago

Okay, I’ll take a second look

fjogeleit commented 8 months ago

@Mitchell-Eaton can you please check again? Updated some tooling, for any reason where my changes not reflected in the builded code. Should be fine now. Tested it by myself.

Mitchell-Eaton commented 8 months ago

Great - I can see my GHA's running green and simply printing "Pull Request already exists" as info. Thanks!

fjogeleit commented 8 months ago

Released with v0.14.0