以 sudo 身份运行 Github Action

use*_*214 14 github github-actions

我正在使用fastlane Github 操作。我需要以 root 用户身份运行它。

      - name: Deploy
        uses: maierj/fastlane-action@v1.4.0
        with:
          lane: 'alpha'
          subdirectory: 'android-staging'
Run Code Online (Sandbox Code Playgroud)

我怎样才能以 sudo 方式运行它?

ste*_*and 2

来自https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#administrative-privileges

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