Remove action for creating pr and use gh cli instead
Related to #1506 discussion
I've used sigstore similar PR as reference https://github.com/sigstore/root-signing/pull/1097
It is correctly creating the PR https://github.com/joycebrum/distroless/pull/2 (I've forced a change just for it to have something to commit), although it created with my user because I've provided the AUTH_KEY.
I noticed it will now fail if there is nothing to commit: https://github.com/joycebrum/distroless/actions/runs/7756341825/job/21153447586#step:6:14 , do we want it to fail if there is nothing to update or should I handle this error to be a success instead (with a warning or log explaining what happened perhaps)?
I noticed it will now fail if there is nothing to commit: https://github.com/joycebrum/distroless/actions/runs/7756341825/job/21153447586#step:6:14 , do we want it to fail if there is nothing to update or should I handle this error to be a success instead (with a warning or log explaining what happened perhaps)?
git commit has an option --allow-empty but I'm not sure that's the right thing to do here - if there's nothing to commit, should we really just gracefully exit the workflow?
We're lazy here and really on the action to do nothing if nothing is needed
I think we can check the diff and if nothing has changed, end the job successfully there?
I think we can check the diff and if nothing has changed, end the job successfully there?
Agreed, no need to get failures when simply there is nothing to be done. I'll do that.
After struggling a little with it, I was able to ensure some of the features the action provided:
-
It won't break if there is nothing to commit https://github.com/joycebrum/distroless/actions/runs/7917065811
-
It can successfully create the pull request if there are changes and no PR exists https://github.com/joycebrum/distroless/actions/runs/7917017677
-
It can successfully update an existing PR https://github.com/joycebrum/distroless/actions/runs/7917040800
PR created and updated https://github.com/joycebrum/distroless/pull/7