1

我正在尝试使用开源Act实用程序在本地测试 github 操作。

“全局思考,act局部思考”

我已经复制了要检查 github 操作的 git hub 存储库,它确实包含 .github/workflow 文件夹。
我运行这个命令来运行我的 github 操作。

act -v workflow_dispatch

它给出了这个错误

DEBU[0000] Loading environment from /home/harshal/harshal/open-horizon.github.io/.env 
DEBU[0000] Loading secrets from /home/harshal/harshal/open-horizon.github.io/.secrets 
DEBU[0000] Loading workflows from '/home/harshal/harshal/open-horizon.github.io/.github/workflows' 
DEBU[0000] Loading workflows recursively                
DEBU[0000] Found workflow 'anaxdocscopy.yml' in '/home/harshal/harshal/open-horizon.github.io/.github/workflows/anaxdocscopy.yml' 
DEBU[0000] Found workflow 'link-snitch.yml' in '/home/harshal/harshal/open-horizon.github.io/.github/workflows/link-snitch.yml' 
DEBU[0000] Reading workflow '/home/harshal/harshal/open-horizon.github.io/.github/workflows/anaxdocscopy.yml' 
DEBU[0000] Correcting if statements '/home/harshal/harshal/open-horizon.github.io/.github/workflows/anaxdocscopy.yml' 
DEBU[0000] Reading workflow '/home/harshal/harshal/open-horizon.github.io/.github/workflows/link-snitch.yml' 
DEBU[0000] Correcting if statements '/home/harshal/harshal/open-horizon.github.io/.github/workflows/link-snitch.yml' 
DEBU[0000] Planning event: workflow_dispatch            
DEBU[0000] Loading slug from git directory '/home/harshal/harshal/open-horizon.github.io/.git' 
DEBU[0000] Found revision: a632f3efe8b7c29bc69794bcbf1f6ecd323467f0 
DEBU[0000] Loading revision from git directory '/home/harshal/harshal/open-horizon.github.io/.git' 
DEBU[0000] Found revision: a632f3efe8b7c29bc69794bcbf1f6ecd323467f0 
DEBU[0000] HEAD points to 'a632f3efe8b7c29bc69794bcbf1f6ecd323467f0' 
DEBU[0000] using github ref: refs/heads/master          
DEBU[0000] context env => map[ACT:true ISSUE_TEMPLATE:.github/ISSUE_TEMPLATE/check-broken-links.md URL:https://open-horizon.github.io/] 
DEBU[0000] context needs => map[]                       
[Link Snitch/build]   Start image=catthehacker/ubuntu:act-latest
DEBU[0000] Loading slug from git directory '/home/harshal/harshal/open-horizon.github.io/.git' 
DEBU[0000] Found revision: a632f3efe8b7c29bc69794bcbf1f6ecd323467f0 
DEBU[0000] Loading revision from git directory '/home/harshal/harshal/open-horizon.github.io/.git' 
DEBU[0000] Found revision: a632f3efe8b7c29bc69794bcbf1f6ecd323467f0 
DEBU[0000] HEAD points to 'a632f3efe8b7c29bc69794bcbf1f6ecd323467f0' 
DEBU[0000] using github ref: refs/heads/master          
[Link Snitch/build]     docker pull catthehacker/ubuntu:act-latest
DEBU[0000] FIXME: Got an status-code for which error does not match any expected type!!!: -1  module=api status_code=-1
DEBU[0000] Image exists? false                          
DEBU[0000] Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/json?filter=catthehacker%2Fubuntu%3Aact-latest": dial unix /var/run/docker.sock: connect: permission denied
unable to determine if image already exists for image "catthehacker/ubuntu:act-latest" () 
DEBU[0000] Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/json?filter=catthehacker%2Fubuntu%3Aact-latest": dial unix /var/run/docker.sock: connect: permission denied
unable to determine if image already exists for image "catthehacker/ubuntu:act-latest" () 
DEBU[0000] Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/json?filter=catthehacker%2Fubuntu%3Aact-latest": dial unix /var/run/docker.sock: connect: permission denied
unable to determine if image already exists for image "catthehacker/ubuntu:act-latest" () 
DEBU[0000] Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/json?filter=catthehacker%2Fubuntu%3Aact-latest": dial unix /var/run/docker.sock: connect: permission denied
unable to determine if image already exists for image "catthehacker/ubuntu:act-latest" () 
DEBU[0000] Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/json?filter=catthehacker%2Fubuntu%3Aact-latest": dial unix /var/run/docker.sock: connect: permission denied
unable to determine if image already exists for image "catthehacker/ubuntu:act-latest" () 
DEBU[0000] Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/json?filter=catthehacker%2Fubuntu%3Aact-latest": dial unix /var/run/docker.sock: connect: permission denied
unable to determine if image already exists for image "catthehacker/ubuntu:act-latest" () 
DEBU[0000] Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/json?filter=catthehacker%2Fubuntu%3Aact-latest": dial unix /var/run/docker.sock: connect: permission denied
unable to determine if image already exists for image "catthehacker/ubuntu:act-latest" () 
DEBU[0000] Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/json?filter=catthehacker%2Fubuntu%3Aact-latest": dial unix /var/run/docker.sock: connect: permission denied
unable to determine if image already exists for image "catthehacker/ubuntu:act-latest" () 
DEBU[0000] Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/json?filter=catthehacker%2Fubuntu%3Aact-latest": dial unix /var/run/docker.sock: connect: permission denied
unable to determine if image already exists for image "catthehacker/ubuntu:act-latest" () 
DEBU[0000] Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/json?filter=catthehacker%2Fubuntu%3Aact-latest": dial unix /var/run/docker.sock: connect: permission denied
unable to determine if image already exists for image "catthehacker/ubuntu:act-latest" () 
DEBU[0000] Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/json?filter=catthehacker%2Fubuntu%3Aact-latest": dial unix /var/run/docker.sock: connect: permission denied
unable to determine if image already exists for image "catthehacker/ubuntu:act-latest" () 
Error: unable to determine if image already exists for image "catthehacker/ubuntu:act-latest" (): Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/json?filter=catthehacker%2Fubuntu%3Aact-latest": dial unix /var/run/docker.sock: connect: permission denied

我是 docker 新手,我对它一无所知,只是它为运行软件创建容器(类似于操作系统)。我尝试在 github 问题上搜索 Act,但找不到任何东西。
我安装了 docker ,sudo snap install docker然后我检查了echo $?which give out0docker -vwhich give out Docker version 20.10.8, build 3967b7d28e,所以看起来我确实安装了运行 docker 然后仍然为什么它会给出这个错误。
这是我编写的 github 操作/工作流文件

name: Link Snitch

on:
  schedule:
    - cron:  '0 1 1 * *'
  workflow_dispatch:
  
 
env:
  URL: https://open-horizon.github.io/
  ISSUE_TEMPLATE: ".github/ISSUE_TEMPLATE/check-broken-links.md"

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - name: Check out master
        uses: actions/checkout@master
        with:
          fetch-depth: 1

      - name: Report broken links
        uses: victoriadrake/link-snitch@master
        with:
          Resursive urls: true
          URL: https://open-horizon.github.io/

        if: ${{ failure() }}
      - uses: JasonEtco/create-an-issue@v2.4.0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          filename: ${{ env.ISSUE_TEMPLATE }}
        if: ${{ failure() }}
4

1 回答 1

0

我仍然不知道行为不起作用的原因。

但是当我以 root 权限运行相同的命令时,它可以工作,所以我想它正在尝试做一些需要 root 授权的事情。如果有人可以对此进行扩展,那将很有帮助,谢谢。

于 2021-09-29T18:06:11.337 回答