sparkfabrik / ios-build-action

Build iOS project (.xcodeproj, .xcworkspace), export .ipa, optional upload to BrowserStack App Live.
MIT License
129 stars 24 forks source link

Error cloning certificates repo #25

Closed luzdealba closed 5 months ago

luzdealba commented 8 months ago

Hi! I believe this is realted to #14 (which I wasn't able to re-open).

I am running v2.3.2, and I have tried everything under the sun to access the certificate repo to no avail.

(...)
+---------------------------------------------------------------------------------------+
|                               Summary for match 2.217.0                               |
+----------------------------------------+----------------------------------------------+
| type                                   | development                                  |
| api_key                                | ********                                     |
| readonly                               | false                                        |
| generate_apple_certs                   | true                                         |
| skip_provisioning_profiles             | false                                        |
| app_identifier                         | ["com.yyy"]                                  |
| team_id                                | **********                                   |
| storage_mode                           | git                                          |
| git_url                                | https://github.com/xxx/codesigning.git       |
| git_branch                             | master                                       |
| shallow_clone                          | false                                        |
| clone_branch_directly                  | false                                        |
| git_basic_authorization                | ********                                     |
| skip_google_cloud_account_confirmation | false                                        |
| s3_skip_encryption                     | false                                        |
| gitlab_host                            | https://gitlab.com                           |
| keychain_name                          | ios-build.keychain                           |
| keychain_password                      | ********                                     |
| force                                  | false                                        |
| force_for_new_devices                  | false                                        |
| include_mac_in_profiles                | false                                        |
| include_all_certificates               | false                                        |
| force_for_new_certificates             | false                                        |
| skip_confirmation                      | false                                        |
| safe_remove_certs                      | false                                        |
| skip_docs                              | false                                        |
| platform                               | ios                                          |
| derive_catalyst_app_identifier         | false                                        |
| fail_on_name_taken                     | false                                        |
| skip_certificate_matching              | false                                        |
| skip_set_partition_list                | false                                        |
| verbose                                | false                                        |
+----------------------------------------+----------------------------------------------+

[21:34:09]: Cloning remote git repo...
[21:34:09]: If cloning the repo takes too long, you can use the `clone_branch_directly` option in match.
Cloning into '/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/d2023[122](https://github.com/xxx/yyy/actions/runs/7316445164/job/19932034661#step:2:123)4-1635-iqahqj'...
fatal: unable to access 'https://github.com/xxx/codesigning.git/': The requested URL returned error: 400
[21:34:09]: Exit status: [128](https://github.com/xxx/yyy/actions/runs/7316445164/job/19932034661#step:2:129)
[21:34:09]: Error cloning certificates repo, please make sure you have read access to the repository you want to use
[21:34:09]: Run the following command manually to make sure you're properly authenticated:
[21:34:09]: $ git clone https://github.com/xxx/codesigning.git /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/d20231224-[163](https://github.com/xxx/yyy/actions/runs/7316445164/job/19932034661#step:2:164)5-iqahqj -c http.extraheader='Authorization: Basic ***'

The relevant section of the Mach documentation simply says:

To generate your base64 key according to RFC 7617, run this:

echo -n your_github_username:your_personal_access_token | base64

You can find more information about GitHub basic authentication and personal token generation here: https://developer.github.com/v3/auth/#basic-authentication

The PAT I generated was fully scoped, I tried encoding it, and nothing.


My workflow:

name: iOS builder

on:
  workflow_dispatch:

jobs:
  build:
    runs-on: macos-latest

    steps:
      - name: Build iOS Action
        uses: sparkfabrik/ios-build-action@v2.3.2
        with:
          project-path: ${{ vars.PROJECT_PATH }}
          workspace-path: ${{ vars.WORKSPACE_PATH }}
          export-method: development
          #configuration: "Debug", "Release"
          #scheme: MyScheme
          team-id: ${{ vars.TEAM_ID }}
          team-name: ${{ vars.TEAM_NAME }}
          #build-pods: true
          apple-key-id: ${{ secrets.APPLE_KEY_ID }}
          apple-key-issuer-id: ${{ secrets.APPLE_KEY_ISSUER_ID }}
          apple-key-content: ${{ secrets.APPLE_KEY_CONTENT }}
          match-git-url: ${{ vars.MATCH_GIT_URL }}
          match-git-basic-authorization: ${{ secrets.MATCH_GIT_BASIC_AUTH }}
          match-password: ${{ secrets.MATCH_PASSWORD }}
          match-build-type: development
          ios-app-id: com.yyy

What could I be missing?

luzdealba commented 8 months ago

I further looked into the source code:

https://github.com/sparkfabrik/ios-build-action/blob/be021d9f600b104d199a500db7ba479149a6b257/dist/index.js#L1662

Which doesn't seem to make sense, given the documentation already asks to base64 the access token:

match-git-basic-authorization

base64 key to the repo. Generate it with echo -n your_github_username:your_personal_access_token | base64

https://github.com/sparkfabrik/ios-build-action?tab=readme-ov-file#match-git-basic-authorization

Richie911 commented 1 month ago

make sure to check if the PAT has expired or if you have regenerated it you will need to reconvert to base 64