Github Actions using a private repository in platformio library manager

I can see a number of questions on VSCode & private libraries, these don’t help…
I have a private github library which works well doing a local build
I just have the https://github.com/{owner}/{libraryname}.git file (should add I am the owner of both the library and the project.
When I come to create a github action to build the project, pio automatically gets all libraries, and fails when trying to get this (private library)

the platformio.ini contains:

platform = espressif8266
board = sonoff_basic
framework = arduino
lib_deps =
    knolleary/PubSubClient@^2.8
    https://github.com/CG/esp8266-utils.git

however the github action fails with:

[57] Library Manager: PubSubClient @ 2.8.0 has been installed!
[58] Library Manager: Installing git+https://github.com/CG/esp8266-utils.git
[59] git version 2.34.1
[60] Cloning into '/home/runner/.platformio/.cache/tmp/pkg-installing-wu7ibbbp'...
[61] fatal: could not read Username for '[https://github.com](https://github.com/)': No such device or address
[62] VCSBaseException: VCS: Could not process command ['git', 'clone', '--recursive', '--depth', '1',

Is there any way of being able to add credentials to plaformio.ini without having to add something like https://username:password@github.com/

This is general question about Github Workflows. Github and Stackoverflow might be better for this – PlatformIO only invokes git and doesn’t have much else to do with it.

python - Cloning private github repository within organisation in actions - Stack Overflow might be a good solution – it checks the repo out in a local path. You can then use file://... in lib_deps to refer to it.