mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +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
|
# TODO: check every members
|
||||||
- run: cargo clippy -p cargo --lib --no-deps -- -D warnings
|
- 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
|
# Ensure Cargo.lock is up-to-date
|
||||||
lockfile:
|
lockfile:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
//! stale-label
|
//! stale-label
|
||||||
//!
|
//!
|
||||||
//! SYNOPSIS
|
//! SYNOPSIS
|
||||||
//! stale-label [<FILE>]
|
//! stale-label
|
||||||
//!
|
//!
|
||||||
//! DESCRIPTION
|
//! DESCRIPTION
|
||||||
//! Detect stale paths in autolabel definitions in triagebot.toml.
|
//! Detect stale paths in autolabel definitions in triagebot.toml.
|
||||||
@ -11,7 +11,6 @@
|
|||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
use std::fmt::Write as _;
|
use std::fmt::Write as _;
|
||||||
use std::path::Path;
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process;
|
use std::process;
|
||||||
use toml_edit::Document;
|
use toml_edit::Document;
|
||||||
@ -19,9 +18,10 @@ use toml_edit::Document;
|
|||||||
fn main() {
|
fn main() {
|
||||||
let pkg_root = std::env!("CARGO_MANIFEST_DIR");
|
let pkg_root = std::env!("CARGO_MANIFEST_DIR");
|
||||||
let ws_root = PathBuf::from(format!("{pkg_root}/../.."));
|
let ws_root = PathBuf::from(format!("{pkg_root}/../.."));
|
||||||
let triagebot_toml = format!("{pkg_root}/../../triagebot.toml");
|
let path = {
|
||||||
let path = std::env::args_os().nth(1).unwrap_or(triagebot_toml.into());
|
let path = ws_root.join("triagebot.toml");
|
||||||
let path = Path::new(&path).canonicalize().unwrap_or(path.into());
|
path.canonicalize().unwrap_or(path)
|
||||||
|
};
|
||||||
|
|
||||||
eprintln!("Checking file {path:?}\n");
|
eprintln!("Checking file {path:?}\n");
|
||||||
|
|
||||||
@ -85,5 +85,7 @@ fn main() {
|
|||||||
let result = if failed == 0 { "ok" } else { "FAILED" };
|
let result = if failed == 0 { "ok" } else { "FAILED" };
|
||||||
eprintln!("test result: {result}. {passed} passed; {failed} 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