GitHub Action nektos/act command not found.

huangapple go评论52阅读模式
英文:

GitHub Action nektos/act command not found

问题

I am new in github actions and I'm trying to migrate some ADO pipelines.
I define the following triggers and jobs:

  pull_request:
    branches:
      - master
      - development
jobs:
  check:
    name: 'Check'
    runs-on: ubuntu-latest
    steps:
      - name: 'Check out repository code'
        uses: actions/checkout@v3
      - name: 'Nuget Tool Installer'
        uses: nuget/setup-nuget@v1.1.1
      - run: nuget restore MyProject.csproj -PackagesDirectory ./mydirectory/output

When I triggered the action with act pull_request, I get the following output:

[xxxxx] 🐰 Start image=node:16-buster-slim
[xxxxx] ⚡ docker pull image=node:16-buster-slim platform= username= forcePull=true
[xxxxx] ⚡ docker create image=node:16-buster-slim platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[xxxxx] ⚡ docker run image=node:16-buster-slim platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[xxxxx] ☁ git clone 'https://github.com/nuget/setup-nuget' # ref=v1.1.1
[xxxxx] ☁ git clone 'https://github.com/microsoft/setup-msbuild' # ref=v1.1
[xxxxx] ⭐ Run Main Check out repository code
[xxxxx] ⚡ docker cp src=C:\Users\xxxxx. dst=/mnt/c/Users/xxxxx
[xxxxx] ✅ Success - Main Check out repository code
[xxxxx] ⭐ Run Main Nuget Tool Installer
[xxxxx] ⚡ docker cp src=C:\Users\xxxxx.cache\act/nuget-setup-nuget@v1.1.1/ dst=/var/run/act/actions/nuget-setup-nuget@v1.1.1/
[xxxxx] ⚡ docker exec cmd=[node /var/run/act/actions/nuget-setup-nuget@v1.1.1/dist/index.js] user= workdir=
[xxxxx] ⚔ ::debug::Found NuGet version: 6.4.0
[xxxxx] ⚔ ::debug::isExplicit: 6.4.0
[xxxxx] ⚔ ::debug::explicit? true
[xxxxx] ⚔ ::debug::checking cache: /opt/hostedtoolcache/nuget.exe/6.4.0/x64
[xxxxx] ⚔ ::debug::not found
[xxxxx] ⚔ ::debug::Downloading https://dist.nuget.org/win-x86-commandline/v6.4.0/nuget.exe
[xxxxx] ⚔ ::debug::Destination /tmp/662b0c06-5dea-40d4-b8e9-f351b5c188b1
[xxxxx] ⚔ ::debug::download complete
[xxxxx] ⚔ ::debug::Caching tool nuget.exe 6.4.0 x64
[xxxxx] ⚔ ::debug::source file: /tmp/662b0c06-5dea-40d4-b8e9-f351b5c188b1
[xxxxx] ⚔ ::debug::destination /opt/hostedtoolcache/nuget.exe/6.4.0/x64
[xxxxx] ⚔ ::debug::destination file /opt/hostedtoolcache/nuget.exe/6.4.0/x64/nuget.exe
[xxxxx] ⚔ ::debug::finished caching tool
[xxxxx] ⚔ ::debug::nuget.exe cache path: /opt/hostedtoolcache/nuget.exe/6.4.0/x64.
[xxxxx] ⚔ ::debug::Creating dummy 'nuget' script. | Installed nuget.exe version 6.4.0
[xxxxx] ✅ Success - Main Nuget Tool Installer
[xxxxx] ⚙ ::set-env:: NUGET=/opt/hostedtoolcache/nuget.exe/6.4.0/x64/nuget.exe
[xxxxx] ⚙ ::set-output:: nuget-version=6.4.0
[xxxxx] ⚙ ::add-path:: /opt/hostedtoolcache/nuget.exe/6.4.0/x64
[xxxxx] ⭐ Run Main nuget restore MyProject.csproj -PackagesDirectory ./MyProjectFolder/output
[xxxxx] ⚡ docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/2] user= workdir= | /opt/hostedtoolcache/nuget.exe/6.4.0/x64/nuget: 2: /opt/hostedtoolcache/nuget.exe/6.4.0/x64/nuget: mono: not found
[xxxxx] ❌ Failure - Main nuget restore MyProject.csproj -PackagesDirectory ./MyProjectFolder/output
[xxxxx] exitcode '127': command not found, please refer to https://github.com/nektos/act/issues/107 for more information

As the container is still available in docker, I opened a terminal session and attempt to execute the nuget command. It is not available. Do you know what I am doing wrong? I believe that it will become available with nuget/setup-nuget@v1.1.1.

英文:

I am new in github actions and I'm trying to migrate some ADO pipelines.
I define the following triggers and jobs:

on:
  pull_request:
    branches:
      - master
      - development
jobs:
  check:
    name: 'Check'
    runs-on: ubuntu-latest
    steps:
      - name: 'Check out repository code'
        uses: actions/checkout@v3
      - name: 'Nuget Tool Installer'
        uses: nuget/setup-nuget@v1.1.1
      - run: nuget restore MyProject.csproj -PackagesDirectory ./mydirectory/output

When I triggered the action with act pull_request, I get the following output:

> [xxxxx] 🚀 Start image=node:16-buster-slim
> [xxxxx] 🐳 docker pull image=node:16-buster-slim platform= username= forcePull=true
> [xxxxx] 🐳 docker create image=node:16-buster-slim platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
> [xxxxx] 🐳 docker run image=node:16-buster-slim platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
> [xxxxx] ☁ git clone 'https://github.com/nuget/setup-nuget' # ref=v1.1.1
> [xxxxx] ☁ git clone 'https://github.com/microsoft/setup-msbuild' # ref=v1.1
> [xxxxx] ⭐ Run Main Check out repository code
> [xxxxx] 🐳 docker cp src=C:\Users\xxxxx. dst=/mnt/c/Users/xxxxx
> [xxxxx] ✅ Success - Main Check out repository code
> [xxxxx] ⭐ Run Main Nuget Tool Installer
> [xxxxx] 🐳 docker cp src=C:\Users\xxxxx.cache\act/nuget-setup-nuget@v1.1.1/ dst=/var/run/act/actions/nuget-setup-nuget@v1.1.1/
> [xxxxx] 🐳 docker exec cmd=[node /var/run/act/actions/nuget-setup-nuget@v1.1.1/dist/index.js] user= workdir=
> [xxxxx] 💬 ::debug::Found NuGet version: 6.4.0
> [xxxxx] 💬 ::debug::isExplicit: 6.4.0
> [xxxxx] 💬 ::debug::explicit? true
> [xxxxx] 💬 ::debug::checking cache: /opt/hostedtoolcache/nuget.exe/6.4.0/x64
> [xxxxx] 💬 ::debug::not found
> [xxxxx] 💬 ::debug::Downloading https://dist.nuget.org/win-x86-commandline/v6.4.0/nuget.exe
> [xxxxx] 💬 ::debug::Destination /tmp/662b0c06-5dea-40d4-b8e9-f351b5c188b1
> [xxxxx] 💬 ::debug::download complete
> [xxxxx] 💬 ::debug::Caching tool nuget.exe 6.4.0 x64
> [xxxxx] 💬 ::debug::source file: /tmp/662b0c06-5dea-40d4-b8e9-f351b5c188b1
> [xxxxx] 💬 ::debug::destination /opt/hostedtoolcache/nuget.exe/6.4.0/x64
> [xxxxx] 💬 ::debug::destination file /opt/hostedtoolcache/nuget.exe/6.4.0/x64/nuget.exe
> [xxxxx] 💬 ::debug::finished caching tool
> [xxxxx] 💬 ::debug::nuget.exe cache path: /opt/hostedtoolcache/nuget.exe/6.4.0/x64.
> [xxxxx] 💬 ::debug::Creating dummy 'nuget' script. | Installed nuget.exe version 6.4.0
> [xxxxx] ✅ Success - Main Nuget Tool Installer
> [xxxxx] ⚙ ::set-env:: NUGET=/opt/hostedtoolcache/nuget.exe/6.4.0/x64/nuget.exe
> [xxxxx] ⚙ ::set-output:: nuget-version=6.4.0
> [xxxxx] ⚙ ::add-path:: /opt/hostedtoolcache/nuget.exe/6.4.0/x64
> [xxxxx] ⭐ Run Main nuget restore MyProject.csproj -PackagesDirectory ./MyProjectFolder/output
> [xxxxx] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/2] user= workdir= | /opt/hostedtoolcache/nuget.exe/6.4.0/x64/nuget: 2: /opt/hostedtoolcache/nuget.exe/6.4.0/x64/nuget: mono: not found
> [xxxxx] ❌ Failure - Main nuget restore MyProject.csproj -PackagesDirectory ./MyProjectFolder/output
> [xxxxx] exitcode '127': command not found, please refer to https://github.com/nektos/act/issues/107 for more information

As the container is still available in docker, I opened a terminal session and attempt to execute the nuget command. It is not available. Do you know what I am doing wrong? I beleive that it will became available with nuget/setup-nuget@v1.1.1

答案1

得分: 0

这似乎是在 act 版本上出现的错误,无论指定哪个图像,它总是采用缺少许多组件的 slim 版本。在更新到版本 0.2.44 后,问题得到了解决,我可以使用所需的图像运行操作。

英文:

This seems to be an error on act version which doesn't matter which image you specify, it always take the slim which lacks a lot of components. After updating to version 0.2.44 the issue got fixed and I could run the action with the required image

huangapple
  • 本文由 发表于 2023年3月31日 02:19:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/75891691.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定