Check Certificates (manage_certificates) #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check Certificates | |
run-name: Check Certificates (${{ github.ref_name }}) | |
on: | |
workflow_dispatch: | |
jobs: | |
check_certs: | |
runs-on: ubuntu-latest | |
env: | |
FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }} | |
FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }} | |
FASTLANE_KEY: ${{ secrets.FASTLANE_KEY }} | |
outputs: | |
cert_expired: ${{ steps.set_output.outputs.cert_expired }} # Job-level output for expired certificates | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
- name: Install dependencies | |
run: bundle install | |
- name: Check Certificates | |
env: | |
FASTLANE_USER: ${{ secrets.APPLE_ID }} | |
FASTLANE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | |
run: bundle exec fastlane check_and_notify_certificates | |
id: check_certs | |
- name: Set output based on Fastlane result | |
id: set_output | |
run: | | |
if [ -f cert_expired.txt ]; then | |
echo "cert_expired=$(cat cert_expired.txt)" >> $GITHUB_ENV | |
else | |
echo "cert_expired=false" >> $GITHUB_ENV | |
fi | |
trigger_create_certs: | |
needs: check_certs | |
if: ${{ needs.check_certs.outputs.cert_expired == 'true' }} | |
uses: ./.github/workflows/create_certs.yml |