distroless icon indicating copy to clipboard operation
distroless copied to clipboard

Remove action for creating pr and use gh cli instead

Open joycebrum opened this issue 1 year ago • 6 comments

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.

joycebrum avatar Feb 02 '24 13:02 joycebrum

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)?

joycebrum avatar Feb 02 '24 13:02 joycebrum

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?

bobcallaway avatar Feb 02 '24 13:02 bobcallaway

We're lazy here and really on the action to do nothing if nothing is needed

loosebazooka avatar Feb 02 '24 14:02 loosebazooka

I think we can check the diff and if nothing has changed, end the job successfully there?

loosebazooka avatar Feb 02 '24 14:02 loosebazooka

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.

joycebrum avatar Feb 02 '24 17:02 joycebrum

After struggling a little with it, I was able to ensure some of the features the action provided:

  1. It won't break if there is nothing to commit https://github.com/joycebrum/distroless/actions/runs/7917065811 image

  2. It can successfully create the pull request if there are changes and no PR exists https://github.com/joycebrum/distroless/actions/runs/7917017677

  3. It can successfully update an existing PR https://github.com/joycebrum/distroless/actions/runs/7917040800 image

PR created and updated https://github.com/joycebrum/distroless/pull/7

joycebrum avatar Feb 15 '24 14:02 joycebrum