pkg: repo: Fix generating random strings
The pipefail option causes the script to terminate with an error, because the pipes are closed while they are still being written to from /dev/urandom. It would be possible to disable pipefail locally for this command, but using openssl seems easier and more robust anyways.
This commit is contained in:
parent
ba8e475d3b
commit
348af13d4e
4
.github/scripts/repository/arch.sh
vendored
4
.github/scripts/repository/arch.sh
vendored
|
@ -35,7 +35,7 @@ GIT_TAG="${GIT_REF#refs/tags/}"
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
pacman -Syu
|
pacman -Syu
|
||||||
pacman -S base-devel git
|
pacman -S base-devel git openssl
|
||||||
|
|
||||||
# clone package repository
|
# clone package repository
|
||||||
git clone -b "${BRANCH_STAGING}" "${REPO}" repo
|
git clone -b "${BRANCH_STAGING}" "${REPO}" repo
|
||||||
|
@ -50,7 +50,7 @@ while read -rd $'\n' FILE; do
|
||||||
rm "${FILE}"
|
rm "${FILE}"
|
||||||
done <<< "$(find . -name '*.pkg.tar.zst')"
|
done <<< "$(find . -name '*.pkg.tar.zst')"
|
||||||
|
|
||||||
RAND="$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 32 | head -n 1)"
|
RAND="$(openssl rand -hex 16)"
|
||||||
BRANCH="${BRANCH_STAGING}-${RAND}"
|
BRANCH="${BRANCH_STAGING}-${RAND}"
|
||||||
|
|
||||||
# set git identity
|
# set git identity
|
||||||
|
|
4
.github/scripts/repository/debian.sh
vendored
4
.github/scripts/repository/debian.sh
vendored
|
@ -35,7 +35,7 @@ GIT_TAG="${GIT_REF#refs/tags/}"
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install git
|
apt-get install git openssl
|
||||||
|
|
||||||
# clone package repository
|
# clone package repository
|
||||||
git clone -b "${BRANCH_STAGING}" "${REPO}" repo
|
git clone -b "${BRANCH_STAGING}" "${REPO}" repo
|
||||||
|
@ -50,7 +50,7 @@ while read -rd $'\n' FILE; do
|
||||||
rm "${FILE}"
|
rm "${FILE}"
|
||||||
done <<< "$(find . -name '*.deb')"
|
done <<< "$(find . -name '*.deb')"
|
||||||
|
|
||||||
RAND="$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 32 | head -n 1)"
|
RAND="$(openssl rand -hex 16)"
|
||||||
BRANCH="${BRANCH_STAGING}-${RAND}"
|
BRANCH="${BRANCH_STAGING}-${RAND}"
|
||||||
|
|
||||||
# set git identity
|
# set git identity
|
||||||
|
|
4
.github/scripts/repository/fedora.sh
vendored
4
.github/scripts/repository/fedora.sh
vendored
|
@ -41,7 +41,7 @@ REPO="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
|
||||||
GIT_TAG="${GIT_REF#refs/tags/}"
|
GIT_TAG="${GIT_REF#refs/tags/}"
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
dnf install git findutils
|
dnf install git findutils openssl
|
||||||
|
|
||||||
# clone package repository
|
# clone package repository
|
||||||
git clone -b "${BRANCH_STAGING}" "${REPO}" repo
|
git clone -b "${BRANCH_STAGING}" "${REPO}" repo
|
||||||
|
@ -56,7 +56,7 @@ while read -rd $'\n' FILE; do
|
||||||
rm "${FILE}"
|
rm "${FILE}"
|
||||||
done <<< "$(find . -name '*.rpm' -type f)"
|
done <<< "$(find . -name '*.rpm' -type f)"
|
||||||
|
|
||||||
RAND="$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 32 | head -n 1)"
|
RAND="$(openssl rand -hex 16)"
|
||||||
BRANCH="${BRANCH_STAGING}-${RAND}"
|
BRANCH="${BRANCH_STAGING}-${RAND}"
|
||||||
|
|
||||||
# set git identity
|
# set git identity
|
||||||
|
|
Loading…
Reference in a new issue