From 4639a85f95a5b519d427c95c73ba0824e0bf5fb6 Mon Sep 17 00:00:00 2001 From: "Esolitos (Marlon)" Date: Mon, 23 Feb 2026 09:37:52 +0100 Subject: [PATCH] fix(upload-rpm): require OS version arg and improve token check Update script to require two arguments: RPM file and OS version, adding validation for OS version input. --- .github/scripts/upload-rpm-to-cloudsmith.sh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/scripts/upload-rpm-to-cloudsmith.sh b/.github/scripts/upload-rpm-to-cloudsmith.sh index f2d20b814c26..77a5aec00221 100755 --- a/.github/scripts/upload-rpm-to-cloudsmith.sh +++ b/.github/scripts/upload-rpm-to-cloudsmith.sh @@ -11,21 +11,17 @@ if [[ -n "${RUNNER_DEBUG:-}" ]]; then set -o xtrace fi -if (( $# < 1 )); then - echo "Usage: $0 " +if (( $# < 2 )); then + echo "Usage: $0 " exit 1 fi -if [ "${CLOUDSMITH_API_TOKEN}" = "" ]; then - echo "Environment CLOUDSMITH_API_TOKEN not set. Exiting." - exit 1 -fi - -RPM=$1 -OS_DISTRO=el -OS_VERSION=$2 +: "${CLOUDSMITH_API_TOKEN:?Environment variable CLOUDSMITH_API_TOKEN must be set.}" main() { + local RPM=$1 ; shift + local OS_VERSION=$2 ; shift + local OS_DISTRO=el # Assuming RHEL/CentOS/Alma/Rocky. FID=$(curl -sSLf \ --upload-file "$RPM" \