File tree 2 files changed +15
-6
lines changed
crates/xtask-stale-label/src
2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 36
36
# TODO: check every members
37
37
- run : cargo clippy -p cargo --lib --no-deps -- -D warnings
38
38
39
+ stale-label :
40
+ runs-on : ubuntu-latest
41
+ steps :
42
+ - uses : actions/checkout@v3
43
+ - run : rustup update stable && rustup default stable
44
+ - run : cargo stale-label
45
+
39
46
# Ensure Cargo.lock is up-to-date
40
47
lockfile :
41
48
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 3
3
//! stale-label
4
4
//!
5
5
//! SYNOPSIS
6
- //! stale-label [<FILE>]
6
+ //! stale-label
7
7
//!
8
8
//! DESCRIPTION
9
9
//! Detect stale paths in autolabel definitions in triagebot.toml.
10
10
//! Probably autofix them in the future.
11
11
//! ```
12
12
13
13
use std:: fmt:: Write as _;
14
- use std:: path:: Path ;
15
14
use std:: path:: PathBuf ;
16
15
use std:: process;
17
16
use toml_edit:: Document ;
18
17
19
18
fn main ( ) {
20
19
let pkg_root = std:: env!( "CARGO_MANIFEST_DIR" ) ;
21
20
let ws_root = PathBuf :: from ( format ! ( "{pkg_root}/../.." ) ) ;
22
- let triagebot_toml = format ! ( "{pkg_root}/../../triagebot.toml" ) ;
23
- let path = std:: env:: args_os ( ) . nth ( 1 ) . unwrap_or ( triagebot_toml. into ( ) ) ;
24
- let path = Path :: new ( & path) . canonicalize ( ) . unwrap_or ( path. into ( ) ) ;
21
+ let path = {
22
+ let path = ws_root. join ( "triagebot.toml" ) ;
23
+ path. canonicalize ( ) . unwrap_or ( path)
24
+ } ;
25
25
26
26
eprintln ! ( "Checking file {path:?}\n " ) ;
27
27
@@ -85,5 +85,7 @@ fn main() {
85
85
let result = if failed == 0 { "ok" } else { "FAILED" } ;
86
86
eprintln ! ( "test result: {result}. {passed} passed; {failed} failed;" ) ;
87
87
88
- process:: exit ( failed as i32 ) ;
88
+ if failed > 0 {
89
+ process:: exit ( 1 ) ;
90
+ }
89
91
}
You can’t perform that action at this time.
0 commit comments