Skip to content

Instantly share code, notes, and snippets.

@sjchmiela
Last active January 21, 2026 07:51
Show Gist options
  • Select an option

  • Save sjchmiela/e941087c0475492eb51e455c105bd4ae to your computer and use it in GitHub Desktop.

Select an option

Save sjchmiela/e941087c0475492eb51e455c105bd4ae to your computer and use it in GitHub Desktop.
jobs:
fingerprint:
name: Fingerprint
# environment: production
# env:
# EXAMPLE_VAR: example
outputs:
android_fingerprint_hash: ${{ steps.fingerprint_step_id.outputs.android_fingerprint_hash }}
ios_fingerprint_hash: ${{ steps.fingerprint_step_id.outputs.ios_fingerprint_hash }}
steps:
- uses: eas/checkout
- name: Verify project uses Continuous Native Generation (CNG)
run: |
is_tracked() {
[ -f "$1" ] && ! git check-ignore -q "$1" || return 1
return 0
}
if is_tracked "android/app/build.gradle" || is_tracked "android/app/src/main/AndroidManifest.xml"; then
echo "Detected generic Android project. Only managed workflow (CNG) is supported" && exit 1
fi
# Use || true to prevent find from causing script exit if no files are found
xcodeproj=$(find "ios" -name "*.xcodeproj" -type d 2>/dev/null | head -n 1 || true)
if [ -n "$xcodeproj" ] && is_tracked "$xcodeproj/project.pbxproj"; then
echo "Detected generic iOS project. Only managed workflow (CNG) is supported" && exit 1
fi
- uses: eas/install_node_modules
- name: Install additional tools
run: |
if ! command -v jq &> /dev/null; then
sudo apt-get update -y && sudo apt-get install -y jq
else
echo "Tools are ready."
fi
- name: Generate fingerprints
id: fingerprint_step_id
run: |
ANDROID_FINGERPRINT=$(npx -y eas-cli@latest fingerprint:generate --platform android --non-interactive --json) || ANDROID_EXIT_CODE=$?
if [ ! -z "$ANDROID_EXIT_CODE" ] && [ $ANDROID_EXIT_CODE -ne 0 ]; then
echo "$ANDROID_FINGERPRINT"
exit $ANDROID_EXIT_CODE
fi
ANDROID_FINGERPRINT_HASH=$(echo $ANDROID_FINGERPRINT | jq -r '.hash')
echo "Android fingerprint is: $ANDROID_FINGERPRINT_HASH"
IOS_FINGERPRINT=$(npx -y eas-cli@latest fingerprint:generate --platform ios --non-interactive --json) || IOS_EXIT_CODE=$?
if [ ! -z "$IOS_EXIT_CODE" ] && [ $IOS_EXIT_CODE -ne 0 ]; then
echo "$IOS_FINGERPRINT"
exit $IOS_EXIT_CODE
fi
IOS_FINGERPRINT_HASH=$(echo $IOS_FINGERPRINT | jq -r '.hash')
echo "iOS fingerprint is: $IOS_FINGERPRINT_HASH"
set-output ios_fingerprint_hash $IOS_FINGERPRINT_HASH
set-output android_fingerprint_hash $ANDROID_FINGERPRINT_HASH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment