Skip to content

[auto-update] Provide option to set the return code while not dry-running #2001

@ktbarrett

Description

@ktbarrett

Summary

I set up a prek auto-update Github Action for my repo and use --check to determine if any updates occurred and then run without --check/--dry-run to actually make the change. This running twice seems kind of unnecessary. I'd like to run the update once and also return an exit code. I need the exit code to determine whether to run the create pull require step. I've also learned I can't just trust the stdout as it's changed over the past couple versions.

One possible solution is to add a --set-rc (not in love with that name) which works for both dry runs and non-dry runs. With such an addition the current --check usage would just be an alias for --dry-run --set-rc. This breaks no existing users and is minimally invasive.

Willing to submit a PR?

  • Yes — I’m willing to open a PR to fix this.

Platform

any

Version

0.3.10

.pre-commit-config.yaml

N/A

Log file

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions