File tree Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 43
43
- run : rustup update stable && rustup default stable
44
44
- run : cargo stale-label
45
45
46
+ check-version-bump :
47
+ runs-on : ubuntu-latest
48
+ env :
49
+ BASE_REF : ${{ github.base_ref }}
50
+ steps :
51
+ - uses : actions/checkout@v3
52
+ - run : rustup update stable && rustup default stable
53
+ - run : ci/validate-version-bump.sh
54
+
46
55
# Ensure Cargo.lock is up-to-date
47
56
lockfile :
48
57
runs-on : ubuntu-latest
@@ -213,6 +222,7 @@ jobs:
213
222
name : bors build finished
214
223
needs :
215
224
- build_std
225
+ - check-version-bump
216
226
- docs
217
227
- lockfile
218
228
- resolver
@@ -229,6 +239,7 @@ jobs:
229
239
name : bors build finished
230
240
needs :
231
241
- build_std
242
+ - check-version-bump
232
243
- docs
233
244
- lockfile
234
245
- resolver
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # This script checks if a crate needs a version bump.
3
+ #
4
+ # At the time of writing, it doesn't check what kind of bump is required.
5
+ # In the future, we could take SemVer compatibliity into account, like
6
+ # integrating `cargo-semver-checks` of else
7
+ #
8
+ # Inputs:
9
+ # BASE_REF The base branch of the pull request wanting to merge into.
10
+
11
+ set -euo pipefail
12
+
13
+ # When `BASE_REF` is missing, we assume it is from bors merge commit,
14
+ # so `HEAD~` should find the previous commit on master branch.
15
+ rev=" ${BASE_REF:- " HEAD~" } "
16
+
17
+ changed_crates=$(
18
+ git diff --name-only " $rev " -- crates/ credential/ benches/ \
19
+ | cut -d' /' -f2 \
20
+ | sort -u
21
+ )
22
+
23
+ if [ -z " $changed_crates " ]
24
+ then
25
+ echo " No file changed in sub crates."
26
+ exit 0
27
+ fi
28
+
29
+ output=$(
30
+ echo " $changed_crates " \
31
+ | xargs printf -- ' --package %s\n' \
32
+ | xargs cargo unpublished --check-version-bump
33
+ )
34
+
35
+ if [ -z " $output " ]
36
+ then
37
+ echo " No version bump needed for sub crates."
38
+ exit 0
39
+ fi
40
+
41
+ echo " $output "
42
+ exit 1
You can’t perform that action at this time.
0 commit comments