diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7a45a31a88..0132b23b81 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/.pre-commit-hooks/runtime-versioner.sh b/.pre-commit-hooks/runtime-versioner.sh new file mode 100755 index 0000000000..2d38197c77 --- /dev/null +++ b/.pre-commit-hooks/runtime-versioner.sh @@ -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