代码之家  ›  专栏  ›  技术社区  ›  Evandro Pomatti

GitHub操作工作流错误:无法创建文件,路径='/GitHub/home/.flutter'

  •  0
  • Evandro Pomatti  · 技术社区  · 5 年前

    我正在运行GitHub操作工作流,但由于以下错误而失败。

    Unhandled exception:
    FileSystemException: Cannot create file, path = '/github/home/.flutter' (OS Error: Permission denied, errno = 13)
    

    我往里面看了看 Workflow syntax for GitHub Actions 但找不到解决这个问题的方法。

    我的生成文件如下所示:

    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
    
    0 回复  |  直到 5 年前
        1
  •  13
  •   Evandro Pomatti    5 年前

    终于有时间看了一下 sudo 解决了。

    图像与用户一起运行 cirrus . 还需要提供完整路径:

    sudo /home/cirrus/sdks/flutter/bin/flutter pub get
    

    从GitHub docs :

    Linux和macOS虚拟机都使用无密码sudo运行。 当您需要执行命令或安装需要更多 比当前用户拥有更多的权限,您可以使用sudo而无需 提供密码。