Files
self/.github/actions/clone-android-passport-nfc-reader/action.yml
Justin Hernandez 1c2a59f6f1 chore: rename android-passport-reader to android-passport-nfc-reader (#1137)
* rename android-passport-reader to android-passport-nfc-reader

* rename action
2025-09-28 17:12:54 -07:00

51 lines
2.1 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Clone android-passport-nfc-reader
description: "Clones the android-passport-nfc-reader repository if it does not exist"
inputs:
working_directory:
description: "Working directory path (where android/ subdirectory is located)"
required: false
default: "."
selfxyz_internal_pat:
description: "SELFXYZ internal repository PAT for private repository access"
required: false
runs:
using: "composite"
steps:
- name: Clone android-passport-nfc-reader
shell: bash
run: |
set -euo pipefail
# Check if PAT is available for private module cloning
if [ -z "${{ inputs.selfxyz_internal_pat }}" ]; then
echo "🔒 Skipping private module cloning (no PAT provided)"
echo " This is expected for forked PRs - build will continue without private modules"
exit 0
fi
cd "${{ inputs.working_directory }}"
if [ ! -d "android/android-passport-nfc-reader" ]; then
echo "📦 Cloning android-passport-nfc-reader for build..."
cd android
# Clone using PAT (embed temporarily, then scrub)
if git clone --depth 1 --quiet "https://${{ inputs.selfxyz_internal_pat }}@github.com/selfxyz/android-passport-nfc-reader.git"; then
echo "✅ android-passport-nfc-reader cloned successfully"
# Immediately scrub the credential from remote URL for security
git -C android-passport-nfc-reader remote set-url origin https://github.com/selfxyz/android-passport-nfc-reader.git || true
else
echo "❌ Failed to clone android-passport-nfc-reader"
echo "Please ensure a valid SELFXYZ internal PAT is provided to this action"
exit 1
fi
elif [ "$CI" = "true" ]; then
echo "⚠️ android-passport-nfc-reader exists in CI - this is unexpected"
echo "📁 Directory contents:"
ls -la android/android-passport-nfc-reader/ || true
else
echo "📁 android-passport-nfc-reader already exists - preserving existing directory"
echo " Local development environment detected - your changes are safe"
fi