Skip to content

Commit 018b19a

Browse files
authored
Always run all CI steps if a Dockerfile is changed (#2558)
1 parent faf8399 commit 018b19a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

runner/src/diffs.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub fn modified_files(scope: &Scope) -> ModifiedContent {
5858
Scope::DiffToMain => Some("main".to_owned()),
5959
};
6060

61-
let files = args.map(|args| {
61+
let files: Option<Vec<String>> = args.map(|args| {
6262
let vec = Command::new("git")
6363
.args(spread!["diff".to_owned(), "--name-only".to_owned(), args,])
6464
.output()
@@ -72,6 +72,15 @@ pub fn modified_files(scope: &Scope) -> ModifiedContent {
7272
.map(|s| format!("./{}", s))
7373
.collect()
7474
});
75+
76+
// If something is changed in a Dockerfile, we'd want to run all CI steps, so set `files` to
77+
// `None` in `ModifiedContent`.
78+
if let Some(ref paths) = files {
79+
if paths.iter().any(|path| path.contains("Dockerfile")) {
80+
return ModifiedContent { files: None };
81+
}
82+
}
83+
7584
ModifiedContent { files }
7685
}
7786

0 commit comments

Comments
 (0)