I have a flutter library in a private GitHub repository I need to use as a dependency when running flutter pub get
from a GitHub Actions workflow. How do I authenticate with git when doing this?
I have tried with dart pub token add
like this:
- name: Get dependencies
env:
PUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
dart pub token add --env-var "$PUB_TOKEN"
flutter pub get
But I keep getting this error:
Resolving dependencies...
Git error. Command: `git clone --mirror /home/runner/.pub-cache/_temp/dirKENEDH`
stdout:
stderr: Cloning into bare repository '/home/runner/.pub-cache/_temp/dirKENEDH'...
fatal: could not read Username for '': No such device or address
exit code: 128
Failed to update packages.
How can I run the flutter pub get
command while being authenticated with GitHub?