gpt4 book ai didi

azure - Pulumi GitHub Action pulumi/actions@v2 : error: It looks like the Pulumi SDK has not been installed. 你运行过npm install 或yarn install 吗?

转载 作者:行者123 更新时间:2023-12-03 02:27:03 35 4
gpt4 key购买 nike

我正在工作 on a project that uses Pulumi to provision some infrastructure pieces on Azure 。我切换到新的pulumi/actions@v2行动which was released recently .

我的 GitHub Actions 工作流程如下所示:

name: pulumi-preview-up

on: [push]

env:
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}

jobs:
preview-up-destroy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install Pulumi CLI
uses: pulumi/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c8a9abbca1a7a6e5a1a6bbbca9a4a4e5b8bda4bda5a1e5aba4a188bef9e6f8e6f9" rel="noreferrer noopener nofollow">[email protected]</a>

- uses: pulumi/actions@v2
with:
command: preview
stack-name: dev

现在我遇到了以下错误(请参阅 the full GHA logs here ):

  Error: code: 255
stdout: Previewing update (github-638882160)

View Live: https://app.pulumi.com/jonashackt/scmbreakoutpulumi/github-638882160/previews/450a1f61-549d-4669-a7de-d8da8fc622f7

pulumi:pulumi:Stack scmbreakoutpulumi-github-638882160 error: It looks like the Pulumi SDK has not been installed. Have you run npm install or yarn install?
pulumi:pulumi:Stack scmbreakoutpulumi-github-638882160 1 message

Diagnostics:
pulumi:pulumi:Stack (scmbreakoutpulumi-github-638882160):
error: It looks like the Pulumi SDK has not been installed. Have you run npm install or yarn install?


stderr: error: failed to load language plugin nodejs: could not read plugin [/home/runner/.pulumi/bin/pulumi-language-nodejs] stdout: EOF

err?:

最佳答案

新的 Pulumi v2 GitHub Action 使用 new Pulumi Automation API 。如the docs state :

This means that there is no supporting functionality for npm or pipinstalls. This functionality should be deferred to the correct GitHubMarketplace actions that support it.

这意味着配置 pulumi/actionspulumi/action-install-pulumi-cli 不再足够(就像我们习惯使用 Pulumi v1 Action 那样)行动。我们还需要自己设置特定于语言的 GitHub Action 环境 - 并且需要自己安装相应的依赖项 - 之前使用pulumi/ Action !

假设使用 JavaScript/Typscript 风格的 Pulumi,我们需要添加 actions/setup-node操作并随后运行 npm install 。在我们的 workflow.yml 中,它看起来像这样:

name: pulumi-preview-up

on: [push]

env:
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}

jobs:
preview-up-destroy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: In order to use the Pulumi v2 action, we need to setup the Pulumi project specific language environment
uses: actions/setup-node@v2
with:
node-version: '14'

- name: After setting up the Pulumi project specific language environment, we need to install the dependencies also
run: npm install

- name: Install Pulumi CLI
uses: pulumi/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="83e2e0f7eaecedaeeaedf0f7e2efefaef3f6eff6eeeaaee0efeac3f5b2adb3adb2" rel="noreferrer noopener nofollow">[email protected]</a>

- uses: pulumi/actions@v2
with:
command: preview
stack-name: dev

如果您选择 JavaScript/TypeScript 之外的其他语言,您还需要设置匹配的环境。文档显示 examples for Python, Go and .Net also .

关于azure - Pulumi GitHub Action pulumi/actions@v2 : error: It looks like the Pulumi SDK has not been installed. 你运行过npm install 或yarn install 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66562876/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com