Getting " Unauthorized Access" error in Git Actions(CI) when trying to run Fastlane(CD)

20 Views Asked by At

This is my first time implementing CI/CD and I am trying to deploy build to test flight using fastlane and git actions but getting error for the following

[10:52:35]: Unauthorized Access

+---------------------------------------------+
|              fastlane summary               |
+------+------------------------+-------------+
| Step | Action                 | Time (in s) |
+------+------------------------+-------------+
| 1    | default_platform       | 0           |
| 2    | increment_build_number | 2           |
|    | get_certificates       | 4           |
+------+------------------------+-------------+

[10:52:35]: fastlane finished with errors

I am using app_store_connect_api_key as a work around for 2FA. It is working fine when I deploy application from fastlane but get this error and asks for code in git actions.

Successfully requested text message to ***********
Please enter the 6 digit code you received at ***********:
Requesting session...
Error: Incorrect verification code

Environment variable `SPACESHIP_2FA_SMS_DEFAULT_PHONE_NUMBER` is set, automatically requesting 2FA token via SMS to that number
SPACESHIP_2FA_SMS_DEFAULT_PHONE_NUMBER = ***********

This is my Yaml file in gitworkflow

name: CI CD 
on:
 push:
  branches:  ["main"]

jobs:
 build-and-test:
  runs-on: macos-latest
  steps:
   - uses: actions/checkout@v2
   - run: fastlane beta
     env:
        FASTLANE_USER : ${{ secrets.FASTLANE_USER }}
        FASTLANE_PASSWORD : ${{ secrets.FASTLANE_PASSWORD }}
        FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}

0

There are 0 best solutions below