github请确保/home/action/azure-kubectl在您的搜索路径中

发布于 2025-02-08 05:14:08 字数 941 浏览 1 评论 0原文

使用以下行安装kubectl和

    - id: install-aks-cli
      run: |
       az aks install-cli --install-location ${{ inputs.kube-ctl-install-location }} --kubelogin-install-location ${{ inputs.kube-login-install-location }}
       echo "$PATH"
       export PATH="/home/actions/azure-kubectl:$PATH"
       export PATH="/home/actions/azure-kubelogin:$PATH"
       echo "$PATH"
       echo "Installed AKS CLI Tools - KubeLogin and KubeCTL"
  shell: bash

kubelogin

/home/actions/runner-state/_work/_temp/17d9e0a3-3af9-49c4-8c59-b95a7f4271e2.sh: line 1: kubelogin: command not found

/home/actions/azure-kubelogin:/home/actions/azure-kubectl:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

后其他系统路径?

我也尝试了以下内容,没有运气,

echo "/home/actions/azure-kubectl" >> GITHUB_PATH

感谢您对如何执行此操作的任何建议。我的跑步者正在使用Linux

After installing KubeCTL and KubeLogin using the following line

    - id: install-aks-cli
      run: |
       az aks install-cli --install-location ${{ inputs.kube-ctl-install-location }} --kubelogin-install-location ${{ inputs.kube-login-install-location }}
       echo "$PATH"
       export PATH="/home/actions/azure-kubectl:$PATH"
       export PATH="/home/actions/azure-kubelogin:$PATH"
       echo "$PATH"
       echo "Installed AKS CLI Tools - KubeLogin and KubeCTL"
  shell: bash

I keep getting the following error when trying this action out

/home/actions/runner-state/_work/_temp/17d9e0a3-3af9-49c4-8c59-b95a7f4271e2.sh: line 1: kubelogin: command not found

When i look at the paths i see the following

/home/actions/azure-kubelogin:/home/actions/azure-kubectl:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

It seems to me i am adding the strings toogether and just replacing the existing as opposed to appending an additional system path?

I've also tried the following and had no luck

echo "/home/actions/azure-kubectl" >> GITHUB_PATH

Appreciate any advice on how to do this. My runner is using linux

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浮生未歇 2025-02-15 05:14:08

更改路径(或任何其他环境变量)对随后在新外壳中运行的步骤没有影响。您需要通过$ github_path来操纵那些路径:

echo "${{ inputs.kube-ctl-install-location }}" >>"${GITHUB_PATH}"

请注意,默认值为〜/.azure-kubectl/

Changing the PATH (or any other environment variable) has no effect on subsequent steps as they run in new shells. You need to manipulate the PATH for those via $GITHUB_PATH like this:

echo "${{ inputs.kube-ctl-install-location }}" >>"${GITHUB_PATH}"

Note that the default is ~/.azure-kubectl/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文