From 152b80e524cbf5479e730629ab61150d9ce2993c Mon Sep 17 00:00:00 2001 From: DeeDeeG Date: Wed, 13 Sep 2023 15:36:48 -0400 Subject: [PATCH] Cirrus: Don't update last good commit if CI skipped For builds that are effectively skipped, since their tasks are all skipped or not scheduled in the first place, we shouldn't update CIRRUS_LAST_GREEN_CHANGE. Unfortunately, Cirrus *does* update that for builds with no or all-skipped tasks, for now. They may fix it in the future, we have a feature request open for it. But for now, this is the workaround. --- .cirrus.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index 5474df4510..f7159e7a55 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -263,3 +263,15 @@ silicon_mac_task: # path: report.xml # type: text/xml # format: junit + +silently_mark_skipped_or_no_scheduled_tasks_builds_as_failed_task: + skip_notifications: true + only_if: $CIRRUS_CRON == "" && $CIRRUS_TAG == "" + ### !!! ^ Don't forget to update this appropriately if our `only_if:` or `skip:` logic changes for the other tasks! !!! ### + ### !!! ^ We want this task to run [only] if all other tasks would have skipped. !!! ### + container: + image: alpine:latest + cpu: 1 + clone_script: exit 0 # Shortest possible script that succeeds. Saves time vs actually cloning. Failing here triggers an automatic re-run, so don't do that! + mark_task_as_failed_script: exit 1 # Shortest possible script to mark a build as "failed". This protects CIRRUS_LAST_GREEN_CHANGE from being updated by builds that actually just skipped CI. + timeout_in: 6s