mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
ci: add job stale-label
This commit is contained in:
parent
981282891f
commit
36653ab85a
7
.github/workflows/main.yml
vendored
7
.github/workflows/main.yml
vendored
@ -36,6 +36,13 @@ jobs:
|
||||
# TODO: check every members
|
||||
- run: cargo clippy -p cargo --lib --no-deps -- -D warnings
|
||||
|
||||
stale-label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- run: rustup update stable && rustup default stable
|
||||
- run: cargo stale-label
|
||||
|
||||
# Ensure Cargo.lock is up-to-date
|
||||
lockfile:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -3,7 +3,7 @@
|
||||
//! stale-label
|
||||
//!
|
||||
//! SYNOPSIS
|
||||
//! stale-label [<FILE>]
|
||||
//! stale-label
|
||||
//!
|
||||
//! DESCRIPTION
|
||||
//! Detect stale paths in autolabel definitions in triagebot.toml.
|
||||
@ -11,7 +11,6 @@
|
||||
//! ```
|
||||
|
||||
use std::fmt::Write as _;
|
||||
use std::path::Path;
|
||||
use std::path::PathBuf;
|
||||
use std::process;
|
||||
use toml_edit::Document;
|
||||
@ -19,9 +18,10 @@ use toml_edit::Document;
|
||||
fn main() {
|
||||
let pkg_root = std::env!("CARGO_MANIFEST_DIR");
|
||||
let ws_root = PathBuf::from(format!("{pkg_root}/../.."));
|
||||
let triagebot_toml = format!("{pkg_root}/../../triagebot.toml");
|
||||
let path = std::env::args_os().nth(1).unwrap_or(triagebot_toml.into());
|
||||
let path = Path::new(&path).canonicalize().unwrap_or(path.into());
|
||||
let path = {
|
||||
let path = ws_root.join("triagebot.toml");
|
||||
path.canonicalize().unwrap_or(path)
|
||||
};
|
||||
|
||||
eprintln!("Checking file {path:?}\n");
|
||||
|
||||
@ -85,5 +85,7 @@ fn main() {
|
||||
let result = if failed == 0 { "ok" } else { "FAILED" };
|
||||
eprintln!("test result: {result}. {passed} passed; {failed} failed;");
|
||||
|
||||
process::exit(failed as i32);
|
||||
if failed > 0 {
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user