Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --exit-code flag to spoom bump #489

Closed
JamieMagee opened this issue Nov 29, 2023 · 3 comments
Closed

Add --exit-code flag to spoom bump #489

JamieMagee opened this issue Nov 29, 2023 · 3 comments
Labels
feature New feature

Comments

@JamieMagee
Copy link

Adding an --exit-code flag to spoom bump, similar to git diff, which sets an exit code if there are files that can be bumped will make spoom bump easier to block builds when someone forgot to bump the strictness of a file.

Currently, the workaround I am using a bash script like:

if bundle exec spoom bump --from=false --to=true | grep 'Bumped'; then
    echo "Files changed by spoom bump. Please run \`bundle exec spoom bump --from=false --to=true\` locally and commit the changes."
    exit 1
fi

See dependabot/dependabot-core#8469 for more information.

@Morriar
Copy link
Collaborator

Morriar commented Nov 29, 2023

Isn't it already the case? You can also use --dry to avoid actually bumping the files.

You can see how we use it on this repo CI step: https://github.com/Shopify/spoom/blob/main/.github/workflows/ruby.yml#L30-L31.

@Morriar Morriar closed this as completed Nov 29, 2023
@JamieMagee
Copy link
Author

Thanks! The documentation doesn't note this, and I didn't dig into the source code.

@Morriar
Copy link
Collaborator

Morriar commented Nov 29, 2023

#490

@Morriar Morriar added the feature New feature label Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

No branches or pull requests

2 participants