Run runtime crate version audit as part of pre-commit (#3450)

This PR makes the runtime-versioner run via pre-commit so that devs will
know if they need to version bump a runtime crate sooner than CI would
otherwise tell them.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
This commit is contained in:
John DiSanti 2024-02-28 14:10:02 -08:00 committed by GitHub
parent 4604aa5b5d
commit 557e4b3976
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View File

@ -32,3 +32,13 @@ repos:
language: system
files: ^.*$
pass_filenames: false
# Check that runtime crates are properly version bumped when changed
- id: runtime-versioner-check
name: runtime-versioner
entry: ./.pre-commit-hooks/runtime-versioner.sh
language: system
# Only run if the rust runtime files change
files: ^.*/?rust-runtime/.*$
pass_filenames: false
# Show the info messages from the runtime versioner that explain how things will publish
verbose: true

View File

@ -0,0 +1,8 @@
#!/bin/bash
#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
set -e
cd "$(git rev-parse --show-toplevel)/tools/ci-build/runtime-versioner" && cargo run -- audit