File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed
crates/xtask-stale-label/src Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 3636 # TODO: check every members
3737 - run : cargo clippy -p cargo --lib --no-deps -- -D warnings
3838
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+
3946 # Ensure Cargo.lock is up-to-date
4047 lockfile :
4148 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 33//! stale-label
44//!
55//! SYNOPSIS
6- //! stale-label [<FILE>]
6+ //! stale-label
77//!
88//! DESCRIPTION
99//! Detect stale paths in autolabel definitions in triagebot.toml.
1010//! Probably autofix them in the future.
1111//! ```
1212
1313use std:: fmt:: Write as _;
14- use std:: path:: Path ;
1514use std:: path:: PathBuf ;
1615use std:: process;
1716use toml_edit:: Document ;
1817
1918fn main ( ) {
2019 let pkg_root = std:: env!( "CARGO_MANIFEST_DIR" ) ;
2120 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+ } ;
2525
2626 eprintln ! ( "Checking file {path:?}\n " ) ;
2727
@@ -77,5 +77,7 @@ fn main() {
7777 let result = if failed == 0 { "ok" } else { "FAILED" } ;
7878 eprintln ! ( "test result: {result}. {passed} passed; {failed} failed;" ) ;
7979
80- process:: exit ( failed as i32 ) ;
80+ if failed > 0 {
81+ process:: exit ( 1 ) ;
82+ }
8183}
You can’t perform that action at this time.
0 commit comments