Rollup merge of #115109 - cuviper:yaml-404, r=albertlarsan68

Skip ExpandYamlAnchors when the config is missing

The dist-src tarball does not include `.github/` at all, so we can't
check whether it needs to be regenerated.
This commit is contained in:
Guillaume Gomez 2023-08-23 17:46:35 +02:00 committed by GitHub
commit b88610fdb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1174,6 +1174,11 @@ impl Step for ExpandYamlAnchors {
/// appropriate configuration for all our CI providers. This step ensures the tool was called
/// by the user before committing CI changes.
fn run(self, builder: &Builder<'_>) {
// Note: `.github/` is not included in dist-src tarballs
if !builder.src.join(".github/workflows/ci.yml").exists() {
builder.info("Skipping YAML anchors check: GitHub Actions config not found");
return;
}
builder.info("Ensuring the YAML anchors in the GitHub Actions config were expanded");
builder.run_delaying_failure(
&mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("check").arg(&builder.src),