#!/usr/bin/env bash # Given changed paths on stdin, print `cosmic=` and `remote=` 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 if [[ "${all}" == 1 ]]; then cosmic=true remote=true fi grep -qE '^images/fedora-cosmic/' <<< "${changed}" && cosmic=true grep -qE '^images/fedora-remote/' <<< "${changed}" && remote=true echo "cosmic=${cosmic}" echo "remote=${remote}"