Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 7
E2e env actions#85
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
E2e env actions #85
Changes from all commits
a75fa8bab67bec22a7b88610d9286ebb0f3f6e583de4322a44a81330bc2f52f27eed96c9e4d1ef5c4f53860c7d44898cab8b76ea8f1008f79884d8a682cafb6a1ff9038bd0652f5e2a6a3ea5d48f3fdcbc7d998790d1bd2bfd20d86d49bacb2e0ef3c35dbc69e75e06dda317803cd24b4b4e46f02ff9a95695370f399c354d87552929ddaad9de05d18421e893cf96adb7822937051d0dade47685292563b49d84a4ca242b1867a9860e85f032380eeea10a613662751a08796367c013d7a349b4459e304ee8ff19e04ceaaa884d6a4d8ac3a3cd1cbb7489088553525cf5b15f5827d99ac3212ff850b3ea3886bcaf1ea7a9c6771387877ab48f952e7228375d942920c9620dc6fe7aeaf8b417a11952a4cd57fedFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| name: 'Configure Keystore' | ||
| description: 'Assume an AWS role and fetch a secret into environment variables' | ||
| inputs: | ||
| aws-role-to-assume: | ||
| description: 'The AWS IAM role to assume' | ||
| required: true | ||
| aws-region: | ||
| description: 'The AWS region where the secret is stored' | ||
| required: true | ||
| secret-name: | ||
| description: 'The name of the secret in AWS Secrets Manager' | ||
| required: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Unused Required Input Causes Workflow FailuresThe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Unused Required Input Causes Misleading ConfigurationThe | ||
| platform: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Redundant Secret Name InputThe | ||
| description: 'The platform for which the keystore is being configured (e.g., ios, android)' | ||
| required: true | ||
| target: | ||
| description: 'The target for which the keystore is being configured (e.g., qa, flask, main)' | ||
| required: true | ||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Determine signing secret name | ||
| shell: bash | ||
| run: | | ||
| case "${{ inputs.target }}" in | ||
| qa) | ||
| SECRET_NAME="metamask-mobile-qa-signing-certificates" | ||
| ;; | ||
| flask) | ||
| SECRET_NAME="metamask-mobile-flask-signing-certificates" | ||
| ;; | ||
| main) | ||
| SECRET_NAME="metamask-mobile-main-signing-certificates" | ||
| ;; | ||
| *) | ||
| echo "❌ Unknown environment: ${{ inputs.environment }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Incorrect Error Message Variable ReferenceThe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| echo "AWS_SIGNING_CERT_SECRET_NAME=$SECRET_NAME" >> "$GITHUB_ENV" | ||
cursor[bot] marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| - name: Configure AWS credentials | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| role-to-assume: ${{ inputs.aws-role-to-assume }} | ||
| aws-region: ${{ inputs.aws-region }} | ||
| - name: Fetch secret and export as environment variables | ||
| shell: bash | ||
| run: | | ||
| echo "🔐 Fetching secret from Secrets Manager..." | ||
| secret_json=$(aws secretsmanager get-secret-value \ | ||
| --region "${{ inputs.aws-region }}" \ | ||
| --secret-id "${AWS_SIGNING_CERT_SECRET_NAME}" \ | ||
| --query SecretString \ | ||
| --output text) | ||
| keys=$(echo "$secret_json" | jq -r 'keys[]') | ||
| for key in $keys; do | ||
| value=$(echo "$secret_json" | jq -r --arg k "$key" '.[$k]') | ||
| echo "::add-mask::$value" | ||
| echo "$key=$(printf '%s' "$value")" >> "$GITHUB_ENV" | ||
| echo "✅ Set secret for key: $key" | ||
| done | ||
| - name: Configure Android Signing Certificates | ||
| if: inputs.platform == 'android' | ||
| shell: bash | ||
| run: | | ||
| echo "📦 Configuring Android keystore..." | ||
| if [[ -z "$ANDROID_KEYSTORE" ]]; then | ||
| echo "⚠️ ANDROID_KEYSTORE is not set. Skipping keystore decoding." | ||
| exit 1 | ||
| fi | ||
| # Use provided path if set, fallback to default | ||
| KEYSTORE_PATH="${ANDROID_KEYSTORE_PATH:-/tmp/android.keystore}" | ||
| echo "$ANDROID_KEYSTORE" | base64 --decode > "$KEYSTORE_PATH" | ||
| echo "✅ Android keystore written to $KEYSTORE_PATH" | ||
| - name: Configure iOS Signing Certificates | ||
| if: inputs.platform == 'ios' | ||
| shell: bash | ||
| run: | | ||
| echo "📦 Configuring iOS code signing..." | ||
| # Create paths | ||
| CERT_PATH="$RUNNER_TEMP/build_certificate.p12" | ||
| PROFILE_PATH="$RUNNER_TEMP/build_pp.mobileprovision" | ||
| KEYCHAIN_PATH="$RUNNER_TEMP/app-signing.keychain-db" | ||
| CERT_PW="${IOS_SIGNING_KEYSTORE_PASSWORD}" | ||
| # Decode base64 files | ||
| echo "$IOS_SIGNING_KEYSTORE" | base64 --decode > "$CERT_PATH" | ||
| echo "$IOS_SIGNING_PROFILE" | base64 --decode > "$PROFILE_PATH" | ||
| echo "✅ Decoded .p12 and provisioning profile" | ||
| # Create and unlock keychain | ||
| security create-keychain -p "$CERT_PW" "$KEYCHAIN_PATH" | ||
| security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH" | ||
| security unlock-keychain -p "$CERT_PW" "$KEYCHAIN_PATH" | ||
| # Import cert | ||
| security import "$CERT_PATH" -P "$CERT_PW" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH" > /dev/null | ||
| security set-key-partition-list -S apple-tool:,apple: -k "$CERT_PW" "$KEYCHAIN_PATH" > /dev/null | ||
| security find-identity -p codesigning "$KEYCHAIN_PATH" | ||
| # Install provisioning profile | ||
| mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | ||
| cp "$PROFILE_PATH" ~/Library/MobileDevice/Provisioning\ Profiles/ | ||
| echo "✅ Installed provisioning profile" | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Redundant Secret Input Causes Confusion
The
secret-nameinput is defined as required but is never used by the action. Instead, the secret name is dynamically determined from theenvironmentinput, renderingsecret-nameredundant and confusing.Locations (1)
.github/actions/configure-keystore/action.yml#L10-L13