如何在GitHub动作中易于安装?

尼克拉斯:

在新的GitHub动作中,我试图安装一个软件包,以便在后续步骤之一中使用它。

name: CI

on: [push, pull_request]

jobs:
  translations:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
      with:
        fetch-depth: 1
    - name: Install xmllint
      run: apt-get install libxml2-utils
    # ...

但是这失败了

Run apt-get install libxml2-utils
  apt-get install libxml2-utils
  shell: /bin/bash -e {0}
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
##[error]Process completed with exit code 100.

最好的方法是什么?是否需要接触Docker?

rmunn:

文件说:

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

因此,只需执行以下操作即可:

- name: Install xmllint
  run: sudo apt-get install libxml2-utils

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章