Composer + Trellis + Bedrock Private Composer Repositories

I tried with this Composer failing due to incorrect GitHub fingerprint - #2 by Twansparant solution, but it didn’t work. (when I run composer install from one of the failed deploy release folders, I can see this error Your github oauth token for github.com contains invalid characters:)

so I tried with this other solution Gitlab private repo as composer package - #13 by alwaysblank

# trellis/deploy-hooks/build-before.yml
---
- name: Create composer auth.json
  template:
    src: "{{ playbook_dir }}/deploy-hooks/auth.json.j2"
    dest: "{{ deploy_helper.new_release_path }}/auth.json"
    mode: "0600"
# trellis/group_vars/all/vault.yml
vault_wordpress_env_defaults:
   vault_github_user: 'xxxxx'
   vault_github_pass: 'xxxxx'
# trellis/deploy-hooks/auth.json.j2
{
  "http-basic": {
    "github.com": {
      "username": "{{ vault_github_user }}",
      "password": "{{ vault_github_pass }}"
    }
  }
}

or even (vault_github_pass value is the personal access token ghp_[YOUR-PERSONAL-TOKEN])

# trellis/deploy-hooks/auth.json.j2
{
  "github-oauth": {
    "github.com": "{{ vault_github_pass }}"
  }
}

I even re-provisioning (not sure if this was a step needed), then when I tried to deploy, I can see a new error AnsibleUndefinedVariable: 'vault_github_token' is undefined or AnsibleUndefinedVariable: 'vault_github_user' is undefined (depending of which of the 2 auth.json.j2 I use)

Could someone please point me to the right direction, I am running out of options and I can’t deploy anymore?

is there a way to achieve this or it is better to move from Github to bitbucket in order to have a private wordPress plugins as composer dependencies?

@alwaysblank , @Twansparant I am tagging you because I saw your comments on the similar/related topic (I can’t reply in that topic because the comments are closed)

thanks