Github Actions CI access token does not work

I’m setting up CI action for private repository A under organization.
Private repository A has submodules, which are private repositories of an organization I belong to with full access.

Create personal access token with repo and org access.
In repository A, under settings, add secret, paste personal access token created above.
Create CI action with submodule step that uses the secret created above to clone repositories using https protocol.

Result:

fatal: unable to access ‘https://github.com/organization/sub_repo_name.git/’: The requested URL returned error: 400

Any help appreciated.

1 Like

Exactly how does this step look? The most likely issue is that the secret isn’t actually used for some reason.

    - name: Checkout submodules
      shell: pwsh
      env:
        CI_KEY: ${{secrets.CI_TOKEN}}
      run: |
        git config --global http.extraheader "AUTHORIZATION: Basic $env:CI_KEY"
        git submodule sync
        git submodule update --init --recursive

CI_TOKEN is the name of repository secret.

Do you have two factor authentication turned on? On your PAT, if it was there, did you click the enable SSO button?