Skip to content

Commit a75fd64

Browse files
committed
Use tr for lower casecase
1 parent d8faedc commit a75fd64

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/create_certs.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ jobs:
5959
id: set_output
6060
run: |
6161
CERT_STATUS_FILE="${{ github.workspace }}/fastlane/new_certificate_needed.txt"
62-
ENABLE_NUKE_CERTS=${{ vars.ENABLE_NUKE_CERTS }}
63-
FORCE_NUKE_CERTS=${{ vars.FORCE_NUKE_CERTS }}
62+
# Convert to lowercase for case-insensitive comparison
63+
ENABLE_NUKE_CERTS=$(echo "${{ vars.ENABLE_NUKE_CERTS }}" | tr '[:upper:]' '[:lower:]')
64+
FORCE_NUKE_CERTS=$(echo "${{ vars.FORCE_NUKE_CERTS }}" | tr '[:upper:]' '[:lower:]')
6465
6566
if [ -f "$CERT_STATUS_FILE" ]; then
6667
CERT_STATUS=$(cat "$CERT_STATUS_FILE" | tr -d '\n' | tr -d '\r') # Read file content and strip newlines
@@ -72,19 +73,18 @@ jobs:
7273
fi
7374
7475
# Check if ENABLE_NUKE_CERTS is not set to true when certs are valid
75-
# Note: ${VAR,,} is bash syntax for lowercase conversion, ensuring case-insensitive comparison
76-
if [ "$CERT_STATUS" != "true" ] && [ "${ENABLE_NUKE_CERTS,,}" != "true" ]; then
76+
if [ "$CERT_STATUS" != "true" ] && [ "$ENABLE_NUKE_CERTS" != "true" ]; then
7777
echo "::notice::🔔 Automated renewal of certificates is disabled because the repository variable ENABLE_NUKE_CERTS is not set to 'true'."
7878
fi
7979
8080
# Check if ENABLE_NUKE_CERTS is not set to true when certs are not valid
81-
if [ "$CERT_STATUS" = "true" ] && [ "${ENABLE_NUKE_CERTS,,}" != "true" ]; then
81+
if [ "$CERT_STATUS" = "true" ] && [ "$ENABLE_NUKE_CERTS" != "true" ]; then
8282
echo "::error::❌ No valid distribution certificate found. Automated renewal of certificates was skipped because the repository variable ENABLE_NUKE_CERTS is not set to 'true'."
8383
exit 1
8484
fi
8585
8686
# Check if FORCE_NUKE_CERTS is set to true
87-
if [ "${FORCE_NUKE_CERTS,,}" = "true" ]; then
87+
if [ "$FORCE_NUKE_CERTS" = "true" ]; then
8888
echo "::warning::‼️ Nuking of certificates was forced because the repository variable FORCE_NUKE_CERTS is set to 'true'."
8989
fi
9090

0 commit comments

Comments
 (0)