ci: Use !reference tag for pipeline guard

It's a bit more flexible than yaml anchors, and already used in
mutter for the same purpose.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3370>
This commit is contained in:
Florian Müllner 2024-06-13 17:46:16 +02:00
parent a9cb754d62
commit 92f78a2a06

View File

@ -43,7 +43,7 @@ workflow:
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_BRANCH'
.pipeline_guard: &pipeline_guard
.pipeline-guard:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_TAG'
@ -94,7 +94,8 @@ check_commit_log:
else
echo "Not a merge request" ;
fi
<<: *pipeline_guard
rules:
- !reference [.pipeline-guard, rules]
artifacts:
expire_in: 1 week
paths:
@ -113,7 +114,8 @@ check-merge-request:
else
echo "Not a merge request" ;
fi
<<: *pipeline_guard
rules:
- !reference [.pipeline-guard, rules]
artifacts:
expire_in: 1 week
paths: