Provide Github Actions secrets to Fastlane

Viewed 747

I am new to Fastlane and Github actions so this might be a stupid question. So currently I am trying to authenticate with Apple using the API key and then distribute it to firebase, to achieve this purpose I created all the necessary keys in Apple and firebase consoles and tested it locally by hard coding the keys and everything works.

Now I want to use these keys through GitHub secrets and I am not sure what is the correct way to pass these secrets to Fastlane

GA

  - name: Authenticate with Apple
    env:
      BUILD_NUMBER: ${{ github.run_number }}
      QA_Group: ${{ env.qa_group }}
      Release_Notes: ${{ github.event.head_commit.message }}
      APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.MOBILE_APPLE_KEY_ID }}
      APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.MOBILE_APPLE_ISSUER_ID }}
      APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.MOBILE_APPLE_KEY }}
      FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
    run: |
      bundle exec fastlane ios apple_authenication

Fast file

lane :apple_authenication do |options| export_method = options[:export_method]

app_store_connect_api_key(
  key_id: ENV['APP_STORE_CONNECT_API_KEY_KEY_ID'],
  issuer_id: ENV['APP_STORE_CONNECT_API_KEY_ISSUER_ID'],
  key_content: ENV['APP_STORE_CONNECT_API_KEY_KEY'],
  is_key_content_base64: true,
  duration: 500,
  in_house: false #boolean value if team is Enterprise or not
)

end

I am receiving the below error when running these workflows

Authentication credentials are missing or invalid. - Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens

0 Answers
Related