本文介绍了如何在GitHub Actions工作流程中轻松安装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

In the new GitHub Actions, I am trying to install a package in order to use it in one of the next steps.

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吗?

What's the best way to do this? Do I need to reach for Docker?

推荐答案

文档说:

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

So simply doing the following should work:

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

这篇关于如何在GitHub Actions工作流程中轻松安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 04:37