#!/usr/bin/env bash # Given changed paths on stdin, print `cosmic=`, `remote=` and # `intune=` so the workflow can skip images that didn't change. Shared # files or build tooling changes rebuild everything; empty input # (schedule/manual) rebuilds everything. set -euo pipefail changed="$(cat || true)" all=0 [[ -z "${changed}" ]] && all=1 grep -qE '^(build\.sh|release\.sh|prune-releases\.sh|prune-registry\.sh|ci-changes\.sh|\.gitea/)' <<< "${changed}" && all=1 grep -qE '^images/shared/' <<< "${changed}" && all=1 cosmic=false remote=false intune=false if [[ "${all}" == 1 ]]; then cosmic=true remote=true intune=true fi grep -qE '^images/fedora-cosmic/' <<< "${changed}" && cosmic=true grep -qE '^images/fedora-remote/' <<< "${changed}" && remote=true # Both fedora-intune and fedora-intune-himmelblau. grep -qE '^images/fedora-intune' <<< "${changed}" && intune=true echo "cosmic=${cosmic}" echo "remote=${remote}" echo "intune=${intune}"