Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .github/workflows/create_certs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
run: |
CERT_STATUS_FILE="${{ github.workspace }}/fastlane/new_certificate_needed.txt"
ENABLE_NUKE_CERTS=${{ vars.ENABLE_NUKE_CERTS }}
FORCE_NUKE_CERTS=${{ vars.FORCE_NUKE_CERTS }}

if [ -f "$CERT_STATUS_FILE" ]; then
CERT_STATUS=$(cat "$CERT_STATUS_FILE" | tr -d '\n' | tr -d '\r') # Read file content and strip newlines
Expand All @@ -70,19 +71,23 @@ jobs:
echo "new_certificate_needed=false" >> $GITHUB_OUTPUT
fi

# Check if ENABLE_NUKE_CERTS is not set to true when certs are valid
if [ "$CERT_STATUS" != "true" ] && [ "$ENABLE_NUKE_CERTS" != "true" ]; then
# Normalize variables to lowercase for case-insensitive comparison
ENABLE_NUKE_CERTS_LC=$(echo "$ENABLE_NUKE_CERTS" | tr '[:upper:]' '[:lower:]')
FORCE_NUKE_CERTS_LC=$(echo "$FORCE_NUKE_CERTS" | tr '[:upper:]' '[:lower:]')

# Check if ENABLE_NUKE_CERTS_LC is not set to true when certs are valid
if [ "$CERT_STATUS" != "true" ] && [ "$ENABLE_NUKE_CERTS_LC" != "true" ]; then
echo "::notice::🔔 Automated renewal of certificates is disabled because the repository variable ENABLE_NUKE_CERTS is not set to 'true'."
fi

# Check if ENABLE_NUKE_CERTS is not set to true when certs are not valid
if [ "$CERT_STATUS" = "true" ] && [ "$ENABLE_NUKE_CERTS" != "true" ]; then
# Check if ENABLE_NUKE_CERTS_LC is not set to true when certs are not valid
if [ "$CERT_STATUS" = "true" ] && [ "$ENABLE_NUKE_CERTS_LC" != "true" ]; then
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'."
exit 1
fi

# Check if vars.FORCE_NUKE_CERTS is not set to true
if [ vars.FORCE_NUKE_CERTS = "true" ]; then
# Check if FORCE_NUKE_CERTS_LC is set to true
if [ "$FORCE_NUKE_CERTS_LC" = "true" ]; then
echo "::warning::‼️ Nuking of certificates was forced because the repository variable FORCE_NUKE_CERTS is set to 'true'."
fi

Expand Down