apt-repo-action/import.sh
morph027 17e17969c1
add includedsc command (#9)
* add dsc handler

Signed-off-by: morph027 <[email protected]>
2025-04-28 13:05:49 +02:00

27 lines
748 B
Shell
Executable file

#!/bin/bash
set -e
if [[ -z "${IMPORT_FROM_REPO}" ]]; then
echo "::notice title=Skipping::Skipping import"
exit 0
fi
{
echo "set base_path ${APT_MIRROR_BASE_PATH:-/tmp/apt-mirror}"
echo "set run_postmirror 0"
echo -e "${IMPORT_FROM_REPO}"
} >/tmp/mirror.list
apt-mirror /tmp/mirror.list |& tee /tmp/mirror.log
if grep -E -q -i 'failed|0 bytes will be downloaded' /tmp/mirror.log; then
cat /tmp/mirror.log
if [[ -z "${IMPORT_FROM_REPO_FAILURE_ALLOW}" ]]; then
exit 1
fi
fi
mapfile -t packages < <(find /tmp/apt-mirror/mirror -type f -regex "${IMPORT_FROM_REPO_REGEX:-^.*\.deb}")
# shellcheck disable=SC2128
if [ -n "${packages}" ]; then
# shellcheck disable=SC2048,SC2086
cp -v ${packages[*]} .
fi