I have a flutter project which is fetching a package from a private repo on Github such as:
dependencies:
flutter:
sdk: flutter
my_package:
git:
url: git@github.com:username/my_package.git
ref: main
When I run flutter pub get on my local computer, everything is fine since I have my computer connected to GitHub through ssh, but once I push on GitHub, the GitHub actions I have are failing to fetch the package with the message git@github.com: Permission denied (publickey). I understand the error message, I wonder if there is a better way to do this and pass the action.
Here is the GitHub action script:
name: Flutter
on: [pull_request, push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1.5.0
- name: Install Dependencies
run: flutter packages get
- name: Format
run: flutter format --set-exit-if-changed lib test
- name: Analyze
run: flutter analyze lib test
- name: Run tests
run: flutter test --no-pub --coverage --test-randomize-ordering-seed random