Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Correct way to use fastlane run add_git_tag in UCB

Discussion in 'Unity Build Automation' started by Dasp, Sep 21, 2022.

  1. Dasp

    Dasp

    Joined:
    Sep 25, 2012
    Posts:
    38
    Hi, I'm trying to add functionality to our UCB so when building test build we automatically tag it in git.

    This is shell script I'm using. AP_VERSION_CODE is enviromental variable for version code of our build. The rest is very simple.
    Code (CSharp):
    1. fastlane run add_git_tag grouping:"Test" includes_lane:false prefix:"iOS-${AP_VERSION_CODE}-" postfix:"" build_number:"${UCB_BUILD_NUMBER}" force:true
    2. fastlane run push_git_tags
    After build I receive error
    Code (CSharp):
    1. Adding git tag 'Test/iOS-0.1.0122' .
    2. 108176: $ git tag -am Test/iOS-0.1.0122\ \(fastlane\) --force Test/iOS-0.1.0122
    3. 108177: ▸ Committer identity unknown
    4. 108178:*** Please tell me who you are.
    5. 108179: ▸ Run
    6. 108180: ▸ to set your account's default identity.
    7. 108181: ▸ Omit --global to set the identity only in this repository.
    8. 108182: /BUILD_PATH/.rvm/gems/ruby-2.7.4/gems/fastlane-2.208.0/fastlane_core/lib/fastlane_core/ui/interface.rb:153:in `shell_error!': [!] Exit status of command 'git tag -am Test/iOS-0.1.0122\\ \\(fastlane\\) --force Test/iOS-0.1.0122' was 128 instead of 0. (FastlaneCore::Interface::FastlaneShellError)
    Can I get some help what is wrong with this code? Another question is, why updating AP_VERSION_CODE in pre process doesn't change it's default value. Is it even possible to push tags from UCB?
     
  2. Dasp

    Dasp

    Joined:
    Sep 25, 2012
    Posts:
    38
    bump, anyone from Unity could give insight into this?
     
  3. wrossmck-unity

    wrossmck-unity

    Unity Technologies

    Joined:
    Nov 9, 2021
    Posts:
    87
    this will only work if you grant the user that cloudbuild uses full repo write access. if you're using git+ssh that ssh key needs full api access to your repo.

    the error says "Committer identity unknown" which makes me think that you need to configure the local `git` user identity.

    git config --local user.email "namelastname@domain.example" should do it
     
  4. wrossmck-unity

    wrossmck-unity

    Unity Technologies

    Joined:
    Nov 9, 2021
    Posts:
    87
    if you want faster support please create a support request. we only check the forums in our spare time
     
  5. Dasp

    Dasp

    Joined:
    Sep 25, 2012
    Posts:
    38
    Thanks for the response. Next time I will make support request
     
    Last edited: Sep 28, 2022