Skip to content

Commit ec66eb4

Browse files
committed
ci(ast_tools): run "AST Changes" CI task when CI workflow file changes (#15591)
Add path to CI workflow file to the watch list for "AST Changes" CI task, so the task runs if the workflow is altered.
1 parent 635e74c commit ec66eb4

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.github/generated/ast_changes_watch_list.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
src:
55
- '.github/generated/ast_changes_watch_list.yml'
6+
- '.github/workflows/ci.yml'
67
- 'apps/oxlint/src-js/generated/constants.ts'
78
- 'apps/oxlint/src-js/generated/deserialize.js'
89
- 'apps/oxlint/src-js/generated/keys.ts'

tasks/ast_tools/src/output/yaml.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,21 @@ pub fn print_yaml(code: &str, generator_path: &str) -> String {
1010
impl Output {
1111
/// Generate a watch list YAML file.
1212
///
13-
/// The path of the watch list itself and `tasks/ast_tools/src/**` are added to the list.
13+
/// The path of the watch list itself, `tasks/ast_tools/src/**`, and the CI workflow file are added to the list.
1414
pub fn yaml_watch_list<'s>(
1515
watch_list_path: &'s str,
1616
paths: impl IntoIterator<Item = &'s str>,
1717
) -> Self {
18-
let mut paths = paths
19-
.into_iter()
20-
.chain([watch_list_path, "tasks/ast_tools/src/**"])
21-
.collect::<Vec<_>>();
18+
let additional_paths = [
19+
// This watch list file
20+
watch_list_path,
21+
// All code in `ast_tools`
22+
"tasks/ast_tools/src/**",
23+
// Workflow which runs `ast_tools`
24+
".github/workflows/ci.yml",
25+
];
26+
27+
let mut paths = paths.into_iter().chain(additional_paths).collect::<Vec<_>>();
2228
paths.sort_unstable();
2329

2430
let mut code = "src:\n".to_string();

0 commit comments

Comments
 (0)