Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add input for custom command in firebase emulators:exec #81

Merged
merged 8 commits into from
Sep 16, 2024
Merged
Changes from 6 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
29 changes: 27 additions & 2 deletions .github/workflows/xcodebuild-or-fastlane.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,20 @@
required: false
type: boolean
default: false
firebasejsonpath:
description: |
Path to the firebase.json file that is used to configure the Firebase Emulator.
Defaults to './firebase.json' in the root directory.
required: false
type: string
default: ''
customfirebaseemulatorcommand:
description: |
A custom command that should be run right before executing the fastlane command.
Only used if `setupfirebaseemulator` is set to true, 'fastlanelane' is set, and no `firebaseemulatorimport` is set.
required: false
type: string
default: ''
firebaseemulatorimport:
description: |
Firebase import directory that contains Authentication, Cloud Firestore, Realtime Database and Cloud Storage data for Firebase emulators.
Expand Down Expand Up @@ -372,11 +386,22 @@
export GOOGLE_APPLICATION_CREDENTIALS="$RUNNER_TEMP/google-application-credentials.json"
echo "Stored the Google application credentials at $GOOGLE_APPLICATION_CREDENTIALS"

# Use the custom path to the firebase.json file if provided.
if [ -n "${{ inputs.firebasejsonpath }}" ]; then
export FIREBASE_JSON_PATH="${{ inputs.firebasejsonpath }}"
else
export FIREBASE_JSON_PATH="./firebase.json"
fi

if [ -n "${{ inputs.firebaseemulatorimport }}" ]; then
echo "Importing firebase emulator data from ${{ inputs.firebaseemulatorimport }}"
firebase emulators:exec --import=${{ inputs.firebaseemulatorimport }} 'fastlane ${{ inputs.fastlanelane }}'
firebase emulators:exec -c $FIREBASE_JSON_PATH --import=${{ inputs.firebaseemulatorimport }} 'fastlane ${{ inputs.fastlanelane }}'
else
firebase emulators:exec 'fastlane ${{ inputs.fastlanelane }}'
if [ -n "${{ inputs.customfirebaseemulatorcommand }}" ]; then
firebase emulators:exec -c $FIREBASE_JSON_PATH '${{ inputs.customfirebaseemulatorcommand }} && fastlane ${{ inputs.fastlanelane }}'

Check warning on line 401 in .github/workflows/xcodebuild-or-fastlane.yml

View workflow job for this annotation

GitHub Actions / YAML Lint Check

401:151 [line-length] line too long (155 > 150 characters)
else
firebase emulators:exec -c $FIREBASE_JSON_PATH 'fastlane ${{ inputs.fastlanelane }}'
fi
fi
else
fastlane ${{ inputs.fastlanelane }}
Expand Down
Loading