I'm running a GitHub Actions workflow and it is failing with the following error.
Unhandled exception:
FileSystemException: Cannot create file, path = '/github/home/.flutter' (OS Error: Permission denied, errno = 13)
I looked in Workflow syntax for GitHub Actions but couldn't find any instruction to solve this.
My build file is looking like this:
name: Flutter CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
container:
image: cirrusci/flutter:v1.7.8-hotfix.4
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: flutter pub get
working-directory: my_app
- name: Run tests
run: flutter test
Always use the "git" user $ ssh -T [email protected] > Permission denied (publickey). If your connection failed and you're using a remote URL with your GitHub username, you can change the remote URL to use the "git" user. You should verify your connection by typing: $ ssh -T [email protected] > Hi USERNAME!
This error means the key you are pushing with is attached to another repository as a deploy key, and does not have access to the repository you are trying to push to. To fix this, remove the deploy key from the repository, and add the key to your personal account instead.
GitHub Actions is a continuous integration and continuous delivery (CI/CD) platform that allows you to automate your build, test, and deployment pipeline. You can create workflows that build and test every pull request to your repository, or deploy merged pull requests to production.
Finally got the time to look at it and adding sudo
solved it.
The image runs with user cirrus
. It is also required to provide the full path:
sudo /home/cirrus/sdks/flutter/bin/flutter pub get
From GitHub docs:
The Linux and macOS virtual machines both run using passwordless sudo. When you need to execute commands or install tools that require more privileges than the current user, you can use sudo without needing to provide a password.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With