vsoch / pull-request-action

open a pull request when a branch is pushed or updated
https://github.com/marketplace/actions/pull-request-action
MIT License
173 stars 62 forks source link

Add an option to pass only if no commits between source and target #73

Closed i077 closed 3 years ago

i077 commented 3 years ago

I'm working on nix-community/home-manager#1934, which adds a GitHub workflow to update a lockfile and open (or update) a PR against the update using this action (thank you for this action!). One of the concerns a reviewer raised was that I set PASS_ON_ERROR, which would mean that the step would pass for any arbitrary non-OK response from the PR action. I think options to pass only on specific errors would be convenient in general, but specifically for our use case, we need:

Going off the API documentation, it seems that GitHub will just return a 422 for any error that isn't auth-related. Given that, I'm not sure how easy or maintainable this will be since you might just end up checking the response messages. If this isn't possible, I can put this logic in the step itself, but if it is, I thought it might be a useful option to add here.

vsoch commented 3 years ago

I would add the logic in the step. I’m not sure parsing error messages would be a reliable thing to do over time if they change, etc.

i077 commented 3 years ago

Fair enough, I'll close this then.