Skip to content

Commit

Permalink
Set error when no valid certs and ENABLE_NUKE_CERTS is not 'true'.
Browse files Browse the repository at this point in the history
Remove warnings about other apps from Fastfile, as these are displayed as annotations from check_certs.yml
  • Loading branch information
bjornoleh committed Jan 9, 2025
1 parent 2b625fe commit 8a00ceb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/check_certs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,15 @@ jobs:
echo "new_certificate_needed=false" >> $GITHUB_OUTPUT
fi
# Check if ENABLE_NUKE_CERTS is not set to true
# Check if ENABLE_NUKE_CERTS is not set to true when certs are valid
if [ "$CERT_STATUS" != "true" ] && [ "$ENABLE_NUKE_CERTS" != "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
echo "::notice::🔔 Nuke certificates was skipped because the repository variable ENABLE_NUKE_CERTS is not set to 'true'."
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
Expand Down Expand Up @@ -111,6 +117,5 @@ jobs:
- name: Annotate Summary
run: |
echo "::warning::⚠️⚠️⚠️ Certificates have been recreated successfully."
echo "::warning::⚠️⚠️⚠️ If you have other apps being distributed by GitHub Actions / Fastlane / TestFlight,"
echo "::warning::⚠️⚠️⚠️ please run the '3. Create Certificates' workflow for each of these apps to allow these apps to be built."
echo "::warning::⚠️⚠️⚠️ If you have other apps being distributed by GitHub Actions / Fastlane / TestFlight, please run the '3. Create Certificates' workflow for each of these apps to allow these apps to be built."
echo "::warning::✅✅✅ But don't worry about your existing TestFlight builds, they will keep working!"
6 changes: 0 additions & 6 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,6 @@ platform :ios do
# Handle output for triggering workflow
if new_certificate_needed
puts "❌ Certificate is expired or no certificates found. Creating flag file to trigger renewal or creation of certificate."
puts ""
puts "⚠️⚠️⚠️ All Distribution certificates and TestFlight profiles are being revoked."
puts "⚠️⚠️⚠️ If you have other apps being distributed by GitHub Actions / Fastlane / TestFlight,"
puts "⚠️⚠️⚠️ please run the '3. Create Certificates' workflow for each of these apps to allow these apps to be built."
puts ""
puts "✅✅✅ But don't worry about your existing TestFlight builds, they will keep working!"
else
puts "✅ Distribution certificate is present and valid. No action required."
end
Expand Down

0 comments on commit 8a00ceb

Please sign in to comment.