gpt4 book ai didi

ubuntu - 须藤 : no tty present and no askpass program specified in github actions

转载 作者:行者123 更新时间:2023-12-04 19:06:14 25 4
gpt4 key购买 nike

嘿,所以我有这个 github 操作来保存 package-lock 和 package.json 文件,如下所示:

# workflow that generates the package files for my webapp :)

name: generate-package-files

# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
myWebappBranch:
description: 'my webapp branch'
required: true
default: 'someBranch'
packageRepos:
description: 'repos built out for the job.'
required: true
default: aPackage

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
generate_files:
# The type of runner that the job will run on
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:

#set up node js
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install build essentials
run: sudo apt-get -y install build-essential

#sets up SSH so we can checkout the needed repos.
- name: Setup SSH
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.BITBUCKET_SSH_KEY }}

- name: Check out the webapp for building and make sure it exists first.
run: (test -d my-app) || git clone git@bitbucket.org:my-repo/my-webapp.git

# Runs a set of commands using the runners shell
- name: build package files
working-directory: my-webapp
run: |
git checkout ${{ github.event.inputs.myWebappBranch }}
git pull
npm ci
npm install ${{ github.event.inputs.packageRepos }}

- name: save files
uses: actions/upload-artifact@v2
with:
name: package-lock
path: package*
似乎没问题,不幸的是,当我运行它时,我得到:
Run sudo apt-get -y install build-essential
sudo: no tty present and no askpass program specified
Error: Process completed with exit code 1.
我不太确定我做错了什么。当我四处搜索时,安装的语法应该可以工作,从我所看到的:
https://code-maven.com/slides/github-ci/install-packages-on-ubuntu-linux-in-github-actions

https://docs.github.com/en/actions/using-github-hosted-runners/customizing-github-hosted-runners#installing-software-on-ubuntu-runners
这似乎是正确的解决方案。我已尝试编辑 sudoers 文件,但访问被拒绝。任何帮助都是极好的! :)

最佳答案

为此,您需要允许使用没有密码的 sudo。sudo如果它尝试提示输入密码但不能,则打印此错误消息。

关于ubuntu - 须藤 : no tty present and no askpass program specified in github actions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68929811/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com