Giter Club home page Giter Club logo

actions's Introduction

Slack GitHub Discussions NPM version Python version NuGet version GoDoc License Gitpod ready-to-code

Pulumi's Infrastructure as Code SDK is the easiest way to build and deploy infrastructure, of any architecture and on any cloud, using programming languages that you already know and love. Code and ship infrastructure faster with your favorite languages and tools, and embed IaC anywhere with Automation API.

Simply write code in your favorite language and Pulumi automatically provisions and manages your resources on AWS, Azure, Google Cloud Platform, Kubernetes, and 120+ providers using an infrastructure-as-code approach. Skip the YAML, and use standard language features like loops, functions, classes, and package management that you already know and love.

For example, create three web servers:

const aws = require("@pulumi/aws");
const sg = new aws.ec2.SecurityGroup("web-sg", {
    ingress: [{ protocol: "tcp", fromPort: 80, toPort: 80, cidrBlocks: ["0.0.0.0/0"] }],
});
for (let i = 0; i < 3; i++) {
    new aws.ec2.Instance(`web-${i}`, {
        ami: "ami-7172b611",
        instanceType: "t2.micro",
        vpcSecurityGroupIds: [sg.id],
        userData: `#!/bin/bash
            echo "Hello, World!" > index.html
            nohup python -m SimpleHTTPServer 80 &`,
    });
}

Or a simple serverless timer that archives Hacker News every day at 8:30AM:

const aws = require("@pulumi/aws");

const snapshots = new aws.dynamodb.Table("snapshots", {
    attributes: [{ name: "id", type: "S", }],
    hashKey: "id", billingMode: "PAY_PER_REQUEST",
});

aws.cloudwatch.onSchedule("daily-yc-snapshot", "cron(30 8 * * ? *)", () => {
    require("https").get("https://news.ycombinator.com", res => {
        let content = "";
        res.setEncoding("utf8");
        res.on("data", chunk => content += chunk);
        res.on("end", () => new aws.sdk.DynamoDB.DocumentClient().put({
            TableName: snapshots.name.get(),
            Item: { date: Date.now(), content },
        }).promise());
    }).end();
});

Many examples are available spanning containers, serverless, and infrastructure in pulumi/examples.

Pulumi is open source under the Apache 2.0 license, supports many languages and clouds, and is easy to extend. This repo contains the pulumi CLI, language SDKs, and core Pulumi engine, and individual libraries are in their own repos.

Welcome

  • Get Started with Pulumi: Deploy a simple application in AWS, Azure, Google Cloud, or Kubernetes using Pulumi.

  • Learn: Follow Pulumi learning pathways to learn best practices and architectural patterns through authentic examples.

  • Examples: Browse several examples across many languages, clouds, and scenarios including containers, serverless, and infrastructure.

  • Docs: Learn about Pulumi concepts, follow user-guides, and consult the reference documentation.

  • Registry: Find the Pulumi Package with the resources you need. Install the package directly into your project, browse the API documentation, and start building.

  • Pulumi Roadmap: Review the planned work for the upcoming quarter and a selected backlog of issues that are on our mind but not yet scheduled.

  • Community Slack: Join us in Pulumi Community Slack. All conversations and questions are welcome.

  • GitHub Discussions: Ask questions or share what you're building with Pulumi.

Getting Started

Watch the video

See the Get Started guide to quickly get started with Pulumi on your platform and cloud of choice.

Otherwise, the following steps demonstrate how to deploy your first Pulumi program, using AWS Serverless Lambdas, in minutes:

  1. Install:

    To install the latest Pulumi release, run the following (see full installation instructions for additional installation options):

    $ curl -fsSL https://get.pulumi.com/ | sh
  2. Create a Project:

    After installing, you can get started with the pulumi new command:

    $ mkdir pulumi-demo && cd pulumi-demo
    $ pulumi new hello-aws-javascript

    The new command offers templates for all languages and clouds. Run it without an argument and it'll prompt you with available projects. This command created an AWS Serverless Lambda project written in JavaScript.

  3. Deploy to the Cloud:

    Run pulumi up to get your code to the cloud:

    $ pulumi up

    This makes all cloud resources needed to run your code. Simply make edits to your project, and subsequent pulumi ups will compute the minimal diff to deploy your changes.

  4. Use Your Program:

    Now that your code is deployed, you can interact with it. In the above example, we can curl the endpoint:

    $ curl $(pulumi stack output url)
  5. Access the Logs:

    If you're using containers or functions, Pulumi's unified logging command will show all of your logs:

    $ pulumi logs -f
  6. Destroy your Resources:

    After you're done, you can remove all resources created by your program:

    $ pulumi destroy -y

To learn more, head over to pulumi.com for much more information, including tutorials, examples, and details of the core Pulumi CLI and programming model concepts.

Platform

Languages

Language Status Runtime Versions
JavaScript Stable Node.js Current, Active and Maintenance LTS versions
TypeScript Stable Node.js Current, Active and Maintenance LTS versions
Python Stable Python Supported versions
Go Stable Go Supported versions
.NET (C#/F#/VB.NET) Stable .NET Supported versions
Java Public Preview JDK 11+
YAML Stable n/a n/a

EOL Releases

The Pulumi CLI v1 and v2 are no longer supported. If you are not yet running v3, please consider migrating to v3 to continue getting the latest and greatest Pulumi has to offer! ๐Ÿ’ช

Clouds

Visit the Registry for the full list of supported cloud and infrastructure providers.

Contributing

Visit CONTRIBUTING.md for information on building Pulumi from source or contributing improvements.

actions's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

actions's Issues

Github Actions failing on commit and PR

Am trying out the github actions:
โ€ข I added the example file at .github/main.workflow
โ€ข I added my secrets to githubโ€™s secrets
โ€ข I added those secrets to the secret arrays in main.workflow
However itโ€™s error-ing out on commit:

### STARTED Pulumi Preview (Merged Stack) 23:26:56Z

Pulling image: gcr.io/github-actions-images/action-runner:latest
latest: Pulling from github-actions-images/action-runner
169185f82c45: Pulling fs layer
0ccde4b6b241: Pulling fs layer
d0372f57daa2: Pulling fs layer
165911d108d6: Pulling fs layer
54996bce1de5: Pulling fs layer
165911d108d6: Waiting
54996bce1de5: Waiting
0ccde4b6b241: Verifying Checksum
0ccde4b6b241: Download complete
d0372f57daa2: Verifying Checksum
d0372f57daa2: Download complete
169185f82c45: Verifying Checksum
169185f82c45: Download complete
165911d108d6: Verifying Checksum
165911d108d6: Download complete
54996bce1de5: Verifying Checksum
54996bce1de5: Download complete
169185f82c45: Pull complete
0ccde4b6b241: Pull complete
d0372f57daa2: Pull complete
165911d108d6: Pull complete
54996bce1de5: Pull complete
Digest: sha256:c9bb432ec5ec08ee08b040a9fccacebbbf8a91444dac4721600cf5dca9dae57e
Status: Downloaded newer image for gcr.io/github-actions-images/action-runner:latest
Unable to find image 'pulumi/actions:latest' locally
latest: Pulling from pulumi/actions
743f2d6c1f65: Already exists
977e13fc7449: Pulling fs layer
de5f9e5af26b: Pulling fs layer
0d27ddbe8383: Pulling fs layer
228d55eb5a23: Pulling fs layer
08a6cee74f85: Pulling fs layer
a4f94c473c3e: Pulling fs layer
4c16c080066b: Pulling fs layer
c8ca64cd5dfa: Pulling fs layer
ac54b69c39ba: Pulling fs layer
228d55eb5a23: Waiting
08a6cee74f85: Waiting
a4f94c473c3e: Waiting
4c16c080066b: Waiting
c8ca64cd5dfa: Waiting
ac54b69c39ba: Waiting
0d27ddbe8383: Verifying Checksum
0d27ddbe8383: Download complete
977e13fc7449: Verifying Checksum
977e13fc7449: Download complete
de5f9e5af26b: Verifying Checksum
de5f9e5af26b: Download complete
977e13fc7449: Pull complete
228d55eb5a23: Verifying Checksum
228d55eb5a23: Download complete
a4f94c473c3e: Verifying Checksum
a4f94c473c3e: Download complete
c8ca64cd5dfa: Verifying Checksum
c8ca64cd5dfa: Download complete
4c16c080066b: Verifying Checksum
4c16c080066b: Download complete
ac54b69c39ba: Verifying Checksum
ac54b69c39ba: Download complete
08a6cee74f85: Verifying Checksum
08a6cee74f85: Download complete
de5f9e5af26b: Pull complete
0d27ddbe8383: Pull complete
228d55eb5a23: Pull complete
08a6cee74f85: Pull complete
a4f94c473c3e: Pull complete
4c16c080066b: Pull complete
c8ca64cd5dfa: Pull complete
ac54b69c39ba: Pull complete
Digest: sha256:e5f90dab5542301630923844a4bb00cd98ea881cdb874a4acb39add22f1944e6
Status: Downloaded newer image for pulumi/actions:latest

> [email protected] install /github/workspace/node_modules/grpc
Logging in using access token from PULUMI_ACCESS_TOKEN
> node-pre-gyp install --fallback-to-build --library=static_library

[grpc] Success: "/github/workspace/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc/grpc_node.node" is installed via remote

> @pulumi/[email protected] install /github/workspace/node_modules/@pulumi/aws
node-pre-gyp WARN Using needle for node-pre-gyp https download 
> node scripts/install-pulumi-plugin.js resource aws v0.18.7


Downloading plugin:  0 B / 56.82 MiB    0.00%
Downloading plugin:  2.39 MiB / 56.82 MiB    4.21% 5s
Downloading plugin:  5.56 MiB / 56.82 MiB    9.79% 4s
Downloading plugin:  8.89 MiB / 56.82 MiB   15.65% 3s
Downloading plugin:  12.24 MiB / 56.82 MiB   21.54% 3s
Downloading plugin:  14.89 MiB / 56.82 MiB   26.20% 3s
Downloading plugin:  18.17 MiB / 56.82 MiB   31.97% 2s
Downloading plugin:  20.77 MiB / 56.82 MiB   36.56% 2s
Downloading plugin:  24.01 MiB / 56.82 MiB   42.25% 2s
Downloading plugin:  26.82 MiB / 56.82 MiB   47.20% 2s
Downloading plugin:  29.41 MiB / 56.82 MiB   51.76% 2s
Downloading plugin:  31.43 MiB / 56.82 MiB   55.32% 1s
Downloading plugin:  37.86 MiB / 56.82 MiB   66.62% 1s
Downloading plugin:  43.43 MiB / 56.82 MiB   76.42%
Downloading plugin:  46.89 MiB / 56.82 MiB   82.53%
Downloading plugin:  50.33 MiB / 56.82 MiB   88.57%
Downloading plugin:  52.94 MiB / 56.82 MiB   93.17%
Downloading plugin:  53.66 MiB / 56.82 MiB   94.44%
Downloading plugin:  56.82 MiB / 56.82 MiB  100.00% 3s

> @pulumi/[email protected] install /github/workspace/node_modules/@pulumi/docker
> node scripts/install-pulumi-plugin.js resource docker v0.17.0


Downloading plugin:  0 B / 14.16 MiB    0.00%
Downloading plugin:  2.44 MiB / 14.16 MiB   17.20% 1s
Downloading plugin:  5.43 MiB / 14.16 MiB   38.35%
Downloading plugin:  9.89 MiB / 14.16 MiB   69.79%
Downloading plugin:  14.00 MiB / 14.16 MiB   98.86%
Downloading plugin:  14.16 MiB / 14.16 MiB  100.00% 0s

> @pulumi/[email protected] install /github/workspace/node_modules/@pulumi/kubernetes
[resource plugin aws-0.18.7] installing
[resource plugin docker-0.17.0] installing
> node scripts/install-pulumi-plugin.js resource kubernetes v0.24.0


Downloading plugin:  0 B / 20.12 MiB    0.00%
Downloading plugin:  2.33 MiB / 20.12 MiB   11.58% 1s
Downloading plugin:  5.45 MiB / 20.12 MiB   27.08% 1s
Downloading plugin:  8.45 MiB / 20.12 MiB   41.97%
Downloading plugin:  10.98 MiB / 20.12 MiB   54.56%
Downloading plugin:  17.39 MiB / 20.12 MiB   86.43%
Downloading plugin:  20.12 MiB / 20.12 MiB  100.00% 1s

> [email protected] postinstall /github/workspace/node_modules/protobufjs
[resource plugin kubernetes-0.24.0] installing
npm WARN aws-typescript@ No description
npm WARN aws-typescript@ No repository field.
> node scripts/postinstall

added 202 packages from 243 contributors and audited 1115 packages in 21.869s
npm WARN aws-typescript@ No license field.

found 0 vulnerabilities

### FAILED Pulumi Preview (Merged Stack) 23:28:50Z (1m54.161s)

Everything seems successful but ends up failing

(v2) Configuration handling

In the current action.yml file, we have configured the following:

actions/action.yaml

Lines 7 to 13 in 25b22d4

inputs:
command:
description: 'Pulumi command to run, eg. up'
required: true
stack-name:
description: 'Pulumi Access Token'
required: true

(Don't mind the typo ๐Ÿ˜…)

Do we need more variables?

I am thinking about using runtypes to determine if our configuration is valid. Any thoughts?

Stack mapping (formerly `.pulumi/ci.json`)

Pulumi CLI Action v1 supports using branches to map which stack you want to update. v2 does not support that. We probably want to create some migration guide for users that use this.

Users can either create a separate workflow file for each branch and effectively map branches to stacks that way. I also have a Github Action that can be used cobraz/setup-variables.

Provide a lighter docker image

Currently, the docker image containing the pulumi actions is around 900 MB and takes over 1 minute to pull for every invocation. Could it be possible to use a different, lighter, base image to run pulumi. Maybe based on alpine ?

Pulumi/actions Github action should support mapping stack output to step outputs

In a workflow that has steps not managed by Pulumi, it is required sometimes to use variables from pulumi stack output. A clean way would be to have them available via the outputs of the "stack output" step.
E.g. a simple use case is when I provision buckets in S3 and need they names later on to upload artifacts or test results to S3

Currently I managed to do this in custom action that derives from pulumi/actions image using:

pulumi stack output -j | jq --raw-output 'to_entries | map("::set-output name=" + .key+"::" + (.value | tostring)+"^") | .[]' | xargs -d '^' echo 

calling it in a step and later in next steps using
${{ steps.pulumiOutput.outputs.myBucketName}}

I believe it should be easy to enable this in pulumi/actions , maybe even do it by default/with flag after pulumi up command, so no additional step will be required

Matrix job not respecting stack name.

Matrix job does not respect the stack name, it runs on what seems like the first matrix job to hit the pulumi/actions step.

Expected behavior

The matrix step should respect the stack name

Current behavior

The matrix step is running the same stack every time

Steps to reproduce

Below is the job definition:

jobs:
  changes:
    runs-on: ubuntu-latest
    outputs:
      stacks: ${{ steps.filter.outputs.changes }}
    steps:
      # find out what deploy stack to use
      - uses: actions/checkout@master
      - uses: dorny/[email protected]
        id: filter
        with:
          filters: |
            gcp: 'deploy/gcp/**'
            github: 'deploy/github/**'
            gke: 'deploy/gke/**'
            kubelt: 'deploy/kubelt/**'

  preview:
    needs: changes
    if: >
      github.event_name == 'pull_request'
      && needs.changes.outputs.stacks != '[]'
    runs-on: ubuntu-latest
    env:
      GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
    strategy:
      matrix:
        stack: ${{ fromJson(needs.changes.outputs.stacks) }}
    steps:
      - uses: actions/checkout@master
      - uses: google-github-actions/setup-gcloud@master
        with:
          service_account_key: ${{ secrets.KUBELT_STUDIO_SA_KEY }}
          project_id: ${{ env.KUBELT_STUDIO_PROJECT_KEY }}
          export_default_credentials: true
      - uses: pulumi/actions@v1
        with:
          command: preview
          stack-name: proofzero/${{ matrix.stack }}
        env:
          PULUMI_ROOT: deploy/${{ matrix.stack}}
          IS_PR_WORKFLOW: true
          PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}

image

GCP Artifact Registry authenitication

I am using the action to run a Pulumi script that builds a Docker image, pushes it to Artifact Registry and then upgrades a service on Cloud Run. This works fine locally, but when I run it in the action using a service account with the Owner role, I get a permissions problem for the docker step. These are the errors:

docker push europe-west1-docker.pkg.dev/<project>/docker/specifications:v1.0.29-3689a637972026c4d33c3b2021c44caf7d5f8e99f679a6b0da744d89438d2874' failed with exit code 1

Permission "artifactregistry.repositories.downloadArtifacts" denied on resource "projects/<project>/locations/europe-west1/repositories/docker" (or it may not exist)

Removing the Docker step and just doing the cloud run upgrade works fine.

Documentation outdated

The documentation on Pulumi's website for GitHub Actions uses v1 of the action.

In addition, the "Getting started" sample of this repo doesn't work, since the v2 of the action is not present (the branch does not exist).

Ability to skip commenting when there are no detected changes

When you have a shared repository that has your code and your Pulumi, you might have a pull request that doesn't have infra changes. It would be nice of these PRs didn't have a message added to them just to say that there are no changes.

Could we add some flag to the action that will skip commenting when there are no changes detected?

Helm support

pulumi's helm functionality depends on helm binary. Current Github Action Docker image doesn't have it. Do you have any plans to add it? Or some recommended workarounds?

Local login?

Is it possible to use this workflow with local login instead of Pulumi access token?

proposal: use details, summary tag to hide too match resource on comment

TL;DR

When set COMMENT_ON_PR: 1 for GitHub Actions environment, action bot will comment changes to PR comment. However actions comment may become too long for many resources and it occupy screen visibility for continuous commit.
I would propse using details/summary HTML tag to hide resources result by default.

Current

๐Ÿน pulumi --non-interactive preview --refresh

Previewing update (master):
    pulumi:pulumi:Stack aws-sandbox-master  running 'dotnet build -nologo .'
    pulumi:pulumi:Stack aws-sandbox-master  
    pulumi:pulumi:Stack aws-sandbox-master  Welcome to .NET Core 3.1!
    pulumi:pulumi:Stack aws-sandbox-master  
    pulumi:pulumi:Stack aws-sandbox-master    Restore completed in 6.81 sec for /github/workspace/pulumi/aws-sandbox/infra.csproj.
    pulumi:pulumi:Stack aws-sandbox-master    AwsSandbox -> /github/workspace/pulumi/aws-sandbox/bin/Debug/netcoreapp3.1/infra.dll
    pulumi:pulumi:Stack aws-sandbox-master  
    pulumi:pulumi:Stack aws-sandbox-master      0 Warning(s)
    pulumi:pulumi:Stack aws-sandbox-master  'dotnet build -nologo .' completed successfully
[resource plugin aws-2.8.0] installing
... // many logs....
 ~  pulumi:pulumi:Stack aws-sandbox-master refreshing 'dotnet build -nologo .' completed successfully
 ~  pulumi:pulumi:Stack aws-sandbox-master refreshing 'dotnet build -nologo .' completed successfully
... // depends on count of resource. it may over 200 lines....!!
Diagnostics:
  pulumi:pulumi:Stack (aws-sandbox-master):
    The launch profile "(Default)" could not be applied.
    A usable launch profile could not be located.
 

Permalink: https://app.pulumi.com/YOUR_ORG/aws-sandbox/master/previews/xxxxxxxxxxxxxxxxxxxxxxxxx

After

๐Ÿน pulumi --non-interactive preview --refresh

Details (Click me)

Previewing update (master):
    pulumi:pulumi:Stack aws-sandbox-master  running 'dotnet build -nologo .'
    pulumi:pulumi:Stack aws-sandbox-master  
    pulumi:pulumi:Stack aws-sandbox-master  Welcome to .NET Core 3.1!
    pulumi:pulumi:Stack aws-sandbox-master  
    pulumi:pulumi:Stack aws-sandbox-master    Restore completed in 6.81 sec for /github/workspace/pulumi/aws-sandbox/infra.csproj.
    pulumi:pulumi:Stack aws-sandbox-master    AwsSandbox -> /github/workspace/pulumi/aws-sandbox/bin/Debug/netcoreapp3.1/infra.dll
    pulumi:pulumi:Stack aws-sandbox-master  
    pulumi:pulumi:Stack aws-sandbox-master      0 Warning(s)
    pulumi:pulumi:Stack aws-sandbox-master  'dotnet build -nologo .' completed successfully
[resource plugin aws-2.8.0] installing
...
 ~  pulumi:pulumi:Stack aws-sandbox-master refreshing 'dotnet build -nologo .' completed successfully
 ~  pulumi:pulumi:Stack aws-sandbox-master refreshing 'dotnet build -nologo .' completed successfully
...
Diagnostics:
  pulumi:pulumi:Stack (aws-sandbox-master):
    The launch profile "(Default)" could not be applied.
    A usable launch profile could not be located.

Permalink: https://app.pulumi.com/YOUR_ORG/aws-sandbox/master/previews/xxxxxxxxxxxxxxxxxxxxxxxxx

Effected code line

https://github.com/pulumi/actions/blob/v0.1/entrypoint.sh#L99-L102

NOTE

I feel it friendly if comment describe summary pf changes like xxx new, yyyy update, zzzz remove.

Support for `refresh`

Some of our workflows used the --refresh arg in v1 of the Pulumi GHA. We've successfully migrated to v2 now, but with some hacks. Such as how we refresh our stack.

Our workflow looks like this:

- uses: pulumi/actions@v2
  with:
    command: refresh
    cloud-url: gs://folio-accounting-integrations-pulumi
    stack-name: accounting-integrations-${{ github.event.inputs.environment }}
    work-dir: packages/accounting-integrations
    github-token: ${{ secrets.GITHUB_TOKEN }}

- uses: pulumi/actions@v2
  with:
    command: up
    cloud-url: gs://folio-accounting-integrations-pulumi
    stack-name: accounting-integrations-${{ github.event.inputs.environment }}
    work-dir: packages/accounting-integrations
    github-token: ${{ secrets.GITHUB_TOKEN }} 

What we want is to pass an input, (e.g. refresh: true), which does the same as --refresh did for us. AFAIK, we either have to do stack.refresh() or ask to have this functionality added to Pulumi Automation SDK.

/cc @stack72 @komalali

Creating stacks if they don't exist

Pulumi Automation API supports creating stacks if they don't exist. I think it could be useful to make this possible in the Github Action too.

With it, users can build a workflow that does not require developers/contributors of a repository to have Pulumi installed for all operations. For example, if you want to spin up a stack (environment), for testing.

Fixes: #9

ENOENT: no such file or directory, open '/tmp/automation-logs-preview-WtufVl/eventlog.txt'

I need some help with Pulumi and GitHub actions.
So far it's been working fine until recently I've been getting this error:

Run pulumi/actions@v2
  with:
    command: preview
    stack-name: ***
    work-dir: ./
    comment-on-pr: false
    parallel: 2147483647
    target-dependents: false
    refresh: false
    upsert: false
  env:
    NODE_ENV: production
    PULUMI_ACCESS_TOKEN: ***
    PULUMI_STACK_NAME: ***
    npm_config_yes: true
pulumi preview on ***
  Error: ENOENT: no such file or directory, open '/tmp/automation-logs-preview-WtufVl/eventlog.txt'

Expected behavior

Pulumi Preview succeeds.

Current behavior

Preview succeeds on the Pulumi Console side, but this error interrupts the actions workflow.

Steps to reproduce

  1. Create a workflow with preview action
  2. Run the workflow

Context (Environment)

I'm trying to run a preview action on a pull_request event.
I have the Pulumi bot running as well, and that's working fine and reporting that the preview succeeded.

Github Bot should edit previous comment instead of posting new one.

It would cut down on spam in busy PRs if the Github bot posted a single comment and edited it, instead of posting a new comment every time. This would be consistent with other github bots such as Vercel or Cypress. This also comes with the advantage that the latest preview information is always kept towards the top of the comments, regardless of the number of commits/comments/etc.

I imagine this would be more practical to do once #29 is in.

v1 GitHub Action deprecation notice - 24th Feb 2021

On Friday 26th February 2021, v2 of the Pulumi GitHub Action will be published. This is a new GitHub Action based on TypeScript rather than being a dockerfile based GitHub Action.

What Impact Will This Have On Me?

The functionality that existed in the old dockerfile based action has changed. The action originally handled things such as:

  • gcloud auth activate-service-account
  • gcloud --quiet auth configure-docker
  • yarn workspace install / yarn install
  • npm ci / npm install
  • pip3 install / pipenv install

These actions are no longer handled by the new version of the action. The new action will only handle:

  • pulumi login
  • pulumi [flags]

What is the benefit?

The new Action works much better with the vast ecosystem of other Actions. Rather than an opinionated container with specific tool versions and specified workflows, the new Action focuses solely on Pulumi and lets you set up and customize the rest.

The original container would allow a GitHub Action usage as follows:

name: Pulumi
on:
  push:
    branches:
      - master
jobs:
  up:
    name: Update
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: pulumi/actions@v1
        with:
          command: up
        env:
          PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}

This allowed no customization of the workspace. The new action allows this:

name: Pulumi
on:
  push:
    branches:
      - master
jobs:
  up:
    name: Update
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Install pulumi
        uses: pulumi/[email protected]
      - name: Setup Node
        uses: actions/setup-node@v1
        with:
          node-version: 14.x
      - run: npm install
      - uses: pulumi/actions@v2
        with:
          command: up
          stack-name: dev
        env:
          PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}

The new action is also much faster! The original action had an overhead of approximately 3 minutes to download the docker container and that was before any Pulumi commands. The new NodeJS-based action is much quicker, taking approximately 25 seconds to run before any Pulumi commands.

When Will The Old Container Be Removed?

We are committed to building the old docker based action for the next 6 months. That means we plan to remove the action from our image creation cycle August 31st 2021. During this 6 month period, we will be making sure that critical security patches of the dockerfile are applied and deloyed but we will not be accepting PRs to add new functionality to the docker based action.

Feedback

We are always interested in understanding the usage of the new action and how you feel it would need to change. Please open any issues / feature requests that you believe would be of use!

v2 Action does not honor command parameters

New v2 Action does not honor parameters via command:

Expected behavior

Honor my command line parameters.

Current behavior

Just runs pulumi up

Steps to reproduce

  1. Setup basic Actions workflow with v2 of Pulumi Action
  2. Try to pass command: up --config-file <different config>
  3. Notice that config file is not read from

Cannot run action on branch delete event

I'm trying to implement the following scenario:

  • On PR create a new stack, deploy provision resources with pulumi up and deploy my code
  • On feature branch delete event run pulumi destroy and pulumi stack rm to clean things up.

I have this github action:

name: 'Clean up resources provisioned for PR'

on: 
  delete

jobs:
  clean:
    if: github.event.ref_type == 'branch'
    runs-on: ubuntu-latest
    name: 'Clean up Pulumi resources'
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 1      
      - name : 'Prepare stack name'
        run: |
           deletedBranchName=${{ github.event.ref }}
           stackName=${deletedBranchName//[\/]/-}
           echo $stackName
           echo "STACK_NAME=$stackName" >> $GITHUB_ENV
      - uses: pulumi/actions@v1
        with:
          command: destroy 
        env:
          ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
          ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
          ARM_TENANT_ID : ${{ secrets.ARM_TENANT_ID  }}
          PULUMI_ROOT: infra
          PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
          PULUMI_STACK_NAME: ${{ env.STACK_NAME }}
          IS_PR_WORKFLOW: false

However whenever i'm trying to run it doesn't do anything except logging this message:

/usr/bin/docker run --name cc4956b3361ac347eb495da318693f749e4ece_67c970 --label cc4956 --workdir /github/workspace --rm -e STACK_NAME -e ARM_CLIENT_ID -e ARM_CLIENT_SECRET -e ARM_TENANT_ID -e PULUMI_ROOT -e PULUMI_ACCESS_TOKEN -e PULUMI_STACK_NAME -e IS_PR_WORKFLOW -e INPUT_COMMAND -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/pulumi-azure/pulumi-azure":"/github/workspace" cc4956:b3361ac347eb495da318693f749e4ece  "destroy"
Logging in using access token from PULUMI_ACCESS_TOKEN
Logged in to pulumi.com as [my-name](https://app.pulumi.com/[my-name])
PR event (null) contains no changes and does not warrant a Pulumi Preview
Skipping Pulumi action altogether...

I guess the problem is in this line:
PR event (null) contains no changes and does not warrant a Pulumi Preview

Indeed, there are no changes in this PR... it's not even a PR, but a delete event.

Output is not colorized

GitHub Actions supports colorization, so it would be awesome if it would take the colors of the CLI output and show it correctly.

The colors create less confusion, and make it easier to see what will be added, deleted and replaced.

Don't accept built `dist/` files

As it is very easy to overlook changes in dist/, people can more easy send pull requests where they put malicious code in there. We should find a solution where this is either solved by maintainers or by a GHA workflow.

Potential tasks

  • Remove yarn build from husky
  • Add a GHA step that builds dist files on every Pull Request or push to master (potentially pushes back to the branch?)

/cc @stack72

Action does not fail

The action should fail when there are errors.
In this case, no cloud backend config was provided, pulumi outputed the error, but the action didn't fail

image

Not sure, but some other errors may also be passing.

Passing arguments (e.g. `diff`, `parallel`)

Currently, there is no way to pass any arguments. During development, we added this input:

args: rt.String.Or(rt.Undefined),

Due to the way Pulumi Automation API is built and the way they are handled, we can't just pass that ๐Ÿ‘† over to any of our functions and call it a day. We either have to add some functionality in order to pass arguments to Automation API or find another option.

As of right now, Automation API requires pulumi CLI. This might change in the future, so IMHO, we should probably not expose arguments as if they were command-line arguments/parameters (e.g. --diff). We should expose them as named arguments (e.g. diff: ), so they can be passed along to Automation API.

We should also update our README to explain that this action now uses Pulumi Automation API.

When Pulumi Github app is installed, cannot prevent github-actions bot from commenting as well

I recently added a workflow based on the example in the documentation. I have installed the Pulumi Github app, however, I cannot find a way to prevent getting doubled up preview comments, from both the github-actions bot and the Pulumi app. Currently my workflow looks like this:

name: Pulumi PR preview
on:
  - pull_request
jobs:
  preview:
    name: Preview
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 1
      - uses: pulumi/actions@v1
        with:
          command: preview
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
          IS_PR_WORKFLOW: true
          PULUMI_ROOT: infrastructure
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          COMMENT_ON_PR: 1

This gives me two sets of comments:

image

image

I only want the latter to appear. However, if I remove COMMENT_ON_PR, I get zero comments. If I remove GITHUB_TOKEN I get the error ERROR: COMMENT_ON_PR was set, but GITHUB_TOKEN is not set.

What could I be doing wrong?

In Pulumi GitHub Action, if COMMENT_ON_PR is set, jq fails if OUTPUT_FILE is too many lines

When COMMENT_ON_PR PR is set, if the body of the output from the job is too long (in my case 4743 lines were generated from a docker build), jq will fail as shown below:

/usr/bin/pulumi-action: line 152: /usr/bin/jq: Argument list too long

Example step:

      - uses: docker://pulumi/actions
        with:
          args: preview
        env:
          COMMENT_ON_PR: true
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
          PULUMI_CI: pr
          PULUMI_SKIP_UPDATE_CHECK: true

Related code:

https://github.com/pulumi/pulumi/blob/2b435bb1a7dcb9d8678933cb734374c4821192bd/docker/actions/entrypoint.sh#L150-L154

Test case demonstrating bug:

COMMENT=$(seq 1 1000000); echo '{}' | jq --arg body "$COMMENT" '.body = $body'

Work-around is to not set COMMENT_ON_PR.

[Epic] JavaScript-based GitHub Action: GA

Updated by @infin8x on February 3 with our new epic issue template

Work items

Design and specification ๐Ÿ“”

  • Design: see below
  • Docs plan: update examples, create migration guide from Docker-based to JavaScript-based Action
  • Identify preview customers: @cobraz, other community members as interested
  • Identify the QA checks required for both internal and community contributions

Engineering โš™๏ธ

  • Configuration (#45)
  • Validate setup (Check if SDK is available)
  • Fix Typescript dependency issue (see vercel/ncc#642 and #50)
  • #17
  • #22
  • #23
  • #27
  • #34
  • #35
  • #37
  • #41
  • Add Publish scripts to ensure that v2.x.x also gets tagged as v2
  • Add support for command args
  • Add support for stack outputs
  • Create command dispatch event to allow us to test this the compatibility of the Action with known version of CLI
  • Add support for dependabot
  • Refactor args support

Release coordinator: TBD

  • Demo the feature at TGIF
  • Update examples
  • Make v1 deprecation plan and schedule it
  • Author migration guide
  • Blog post
    • Engineering focus: this uses automation API under the hood
  • Social media & community Slack
  • Usage stats
  • Ship it ๐Ÿš€

Objective and Key Results

  • Objective: Grow, engage, and satisfy our community.
    • Key result: Grow open source contributions 25% MoM.

(v2) Javascript-based Github Actions

Hello ๐Ÿ‘‹

I thought it would be useful to have an issue to track the efforts of making a new Pulumi Github Actions, based on Javascript. As @chrsmith wrote about in #29, there are still things to consider and decide. Below you'll find my list of features I think we should add as well.

  • Add tests
  • Add PULUMI_CI_* environment variables
  • Add .pulumi/ci.json configuration
  • Add stack name input variable
  • Add updated documentation
  • Add PR comment functionality

cc: @chrsmith @praneetloke @jaxxstorm

re #23

entrypoint script failing unexpectedly

We are testing this action on a repo which suddenly fails after initializing npm modules and before printing the command to be run:

# Next, lazily install packages if required.
if [ -e package.json ] && [ ! -d node_modules ]; then
    npm install
fi

# Now just pass along all arguments to the Pulumi CLI, sending the output to a file for
# later use. Note that we exit immediately on failure (under set -e), so we `tee` stdout, but
# allow errors to be surfaced in the Actions log.
PULUMI_COMMAND="pulumi $*"
OUTPUT_FILE=$(mktemp)
echo "#### :tropical_drink: \`$PULUMI_COMMAND\`"
bash -c "$PULUMI_COMMAND" | tee $OUTPUT_FILE
EXIT_CODE=${PIPESTATUS[0]}
audited 577 packages in 3.646s
found 0 vulnerabilities

##[error]Docker run failed with exit code 255

I'm stuck debugging why this is happening.

--non-interactive is specified twice

The --non-interactive flag is set both in the entrypoint.sh script and in the Dockerfile. It doesn't seem to have any adverse effect by being declared twice, but I noticed it when I was trying to make this action work for me.

Need to determine tagging story wrt CLI version

The container currently downloads a specific version of the CLI. However, this version will enviably get out of date as newer versions of Pulumi are released.

However, if we always have the container pull the "latest", then it leaves developers who require a specific CLI version (e.g. to prevent any breaking library changes).

So I think we need to update this package to automatically push new container versions for every release of the CLI? e.g. pulumi/actions:latest, pulumi/actions:v0.16.16, etc. @ellismg does that sound like the right solution?

Proposal: redesign as a JavaScript action

The current implementation has some interoperability issues that might best be fixed by reworking the Pulumi action to be Javascript-based. The ideal would be for the action to interoperate well with:

  • setup-node to configure authentication (incl. scopes, registries)
  • setup-gcloud to establish a service account
  • actions which manipulate the kubeconfig
  • actions which install and configure tools needed by some Pulumi programs (e.g. Helm)

Yes, the existing action attempts to handle some of the above with limited success. In practice, those setups are needed for other CI steps to be successful (e.g. push an image to GCR) anyway and would best be done in a standard way.

Meanwhile, a Javascript-based implementation would just work better. As an example, I struggled with connecting to Kubernetes from my Pulumi program, due to the auth-helper in kubeconfig not being in the path, following a step which ran gcloud container clusters get-credentials.

pulumi/actions@v2 expecting Pulumi v3

Expected behavior

It should not have expecting pulumi v3

Current behavior

Failing with Error

Error: Major version mismatch. You are using Pulumi CLI version 3.0.0 with Automation SDK v2. Please update the SDK.

Steps to reproduce

- name: Preview infra
        uses: pulumi/actions@v2
        with:
          command: preview
          stack-name: ${{ env.PULUMI_STACK }}
          work-dir: pulumi
          comment-on-pr: true
          github-token: ${{ github.token }}
        env:
          PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}

Error building AzureRM Client

Error

warning: A new version of Pulumi is available. To upgrade from version '0.16.6' to '0.16.8', visit https://pulumi.io/install for manual instructions and release notes.
Previewing update (production):

 +  pulumi:pulumi:Stack tryPulumiAction-production create 
    azure:core:ResourceGroup resourceGroup  error: Error building AzureRM Client: Azure CLI Authorization Profile was not found. Please ensure the Azure CLI is installed and then log-in with `az login`.
    azure:core:ResourceGroup resourceGroup  1 error
 
Diagnostics:
  azure:core:ResourceGroup (resourceGroup):
    error: Error building AzureRM Client: Azure CLI Authorization Profile was not found. Please ensure the Azure CLI is installed and then log-in with `az login`.
 
error: an error occurred while advancing the preview

main.workflow

workflow "Update" {
    on = "push"
    resolves = [ "Pulumi Deploy (Current Stack)" ]
}

action "Pulumi Deploy (Current Stack)" {
    uses = "docker://pulumi/actions"
    args = [ "up" ]
    env = {
        "PULUMI_ROOT" = "infra",
        "PULUMI_CI" = "up"
    }
    secrets = [
        "PULUMI_ACCESS_TOKEN"
    ]
}

Consider switching back to using Pulumi CLI under the hood

Please consider switching to using the Pulumi CLI under the hood for the Action. It doesn't make sense for developers to be using pulumi up/preview locally but then CI uses the Automation API (which is still in preview, anyway).

It is important that CI uses the same tooling as local dev to keep things simple and cohesive.

Affected area

We are currently running into a problem where local up is working but we are getting an error in CI for the same code/stack/etc. Will open another ticket for that.

Should error on missing stack configuration

We were getting passing builds in our deploy workflow, but the task was actually not configured for this branch. We're using the config as explained in the README.

Is there something we missed or need to add in our configuration to make sure the task fails if it can't find a proper configuration?

Proposal: Allow deploys to be triggered and stacks to be mapped by tag

As I read it, it appears that the only real way to trigger a deployment to a particular stack is based on a branch mapping. This requires having a seperate "production" branch. Over the years I have found this to be a less ideal way to promote something to production in Github, and have found that using the "Releases" feature has more flexibility. It provides a way to also have somewhere for release notes to be stored, which using something like conventional-commits, can be automatically generated.

I'm proposing some method of allowing a tag to be used to trigger the deploy, and support for mapping tags to stacks.

CircleCI has this feature, and the way they implement is with string matching on the tag name. You can make it wide open, so all tags map to one place, or use a prefix match to further map tag names to particular things.

Add support for Review Pulumi Stacks

Allow the ability for Pulumi stack to be automatically created / destroyed with each PR. This would be a super cool feature to dynamically test preview links for infrastructure changes without having to merge to staging branch.

Cannot run action from a different directory

* Edited to match documentation (https://www.pulumi.com/docs/guides/continuous-delivery/github-actions/#using-a-different-root-directory)

The recommended way of running an action from a different directory is by setting PULUMI_ROOT to the relative directory for a Pulumi project. Since my setup includes a root-level package.json and tsconfig.json, I need to copy both files to the subdirectory (pulumi/pulumi#2619). But doing so doesn't work:

Logging in using access token from PULUMI_ACCESS_TOKEN
Logged in to pulumi.com as juliana
Activated service account credentials for: [***.iam.gserviceaccount.com]
Adding credentials for all GCR repositories.
WARNING: A long list of credential helpers may cause delays running 'docker build'. We recommend passing the registry name to configure only the registry you are using.
Docker configuration file updated.
yarn install v1.22.5
warning package.json: No license field
warning [email protected]: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 22.41s.
#### :tropical_drink: `pulumi --non-interactive preview --suppress-outputs`
Previewing update (...)

View Live: https://app.pulumi.com/**/previews/73e3a996-7730-46b5-bc73-3509ee94b100

    pulumi:pulumi:Stack infrastructure  error: It looks like the Pulumi SDK has not been installed. Have you run npm install or yarn install?
    pulumi:pulumi:Stack infrastructure  1 message
 
Diagnostics:
  pulumi:pulumi:Stack (infrastructure):
    error: It looks like the Pulumi SDK has not been installed. Have you run npm install or yarn install?

The workflow file:

name: Pulumi
on:
  pull_request:
    types: [opened, reopened, synchronize]
    branches:
      - master

jobs:
  preview:
    name: Preview
    runs-on: self-hosted
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - run: mv package.json cluster/package.json && mv yarn.lock cluster/yarn.lock && mv tsconfig.json cluster/tsconfig.json

      - uses: docker://pulumi/actions
        with:
          args: preview --suppress-outputs
        env:
          PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
          GOOGLE_CREDENTIALS: ${{ secrets.GCLOUD_SERVICE_ACCOUNT }}
          COMMENT_ON_PR: 1
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          PULUMI_CI: pr
          PULUMI_ROOT: cluster

Locally, I usually run --cwd to run Pulumi from another directory and works without issues. I also tested running with --cwd on Pulumi's docker image and it works as expected. i.e.:

docker run --rm --name pulumiactions --label foo --workdir /github/workspace -e GITHUB_ACTIONS=true -e GITHUB_WORKFLOW="test" -e PULUMI_CI="pr" -e PULUMI_ACCESS_TOKEN=$PULUMI_ACCESS_TOKEN -e GOOGLE_CREDENTIALS=$GOOGLE_CREDENTIALS -e CI=true -v "$(pwd)":"/github/workspace" pulumi/actions preview --cwd ./cluster --stack stackname --suppress-outputs

But running on Github Actions, it gives me a failed to locate the entry point for your program: /github/workspace error.

#### :tropical_drink: `pulumi --non-interactive preview --cwd ./cluster --stack stackname --suppress-outputs`
Previewing update (stackname)

View Live: ...

    pulumi:pulumi:Stack infrastructure running 
    pulumi:pulumi:Stack infrastructure running We failed to locate the entry point for your program: /github/workspace
    pulumi:pulumi:Stack infrastructure running Here's what we think went wrong:
    pulumi:pulumi:Stack infrastructure running   * Your program looks like a TypeScript program. Have you run 'tsc'?
    pulumi:pulumi:Stack infrastructure  3 messages

The workflow file:

name: Pulumi
on:
  pull_request:
    types: [opened, reopened, synchronize]
    branches:
      - master

jobs:
  preview:
    name: Preview
    runs-on: self-hosted
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 1

      - uses: docker://pulumi/actions
        with:
          args: preview --cwd "./cluster" --stack stackname --suppress-outputs
        env:
          PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
          GOOGLE_CREDENTIALS: ${{ secrets.GCLOUD_SERVICE_ACCOUNT }}
          COMMENT_ON_PR: 1
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          PULUMI_CI: pr

So far I haven't been able to identify why any of these options aren't working and how to make Pulumi work from a subdirectoy.

Pulumi actions not working (Github Actions)

Hey all!
I'm trying to get a basic pulumi example running in github actions and not succeeding. This is a typescript (pulumi) project and everything runs fine locally.

I've tried running the provided docker file as an action and providing the required env variables. This resulted in the following being displayed on the pulumi console until the action was cancled (58 minutes):
pulumi:pulumi:Stack: (same)

I also tried extending the pulumi/pulumi:latest docker image and building my own action with the result being the same as above.

Finally, I copied the Dockerfile from this repo except for the entrypoint.sh which I provided my own and upgraded to 0.16.8. This resulted in the following being displayed for, now 30 minutes:

Changes:
 
    Type                Name              Operation
+   pulumi:pulumi:Stack my-stack-my-stack created

I'm trying to run the basic pulumi stack that comes with pulumi new. My command is pulumi --non-interactive up


It looks as though an error occurs part way through the process and pulumi fails to exit (just hangs)


UPDATE:
Once the github action fails and stops the following is logged in the action:

Previewing update (my-stack):

 +  pulumi:pulumi:Stack my-stack-my-stack create 
@ Previewing update............................................................................................................................................................

UPDATE 2:
calling pulumi --non-interactive up --skip-preview causes the same issue as above except instead of previewing it locks to @updating...........

error: could not find `dotnet` on the $PATH: exec: "dotnet": executable file not found in $PATH

I am trying to setup Pulumi with .net core but I am stuck with the above error. I have tried to use the .net setup action and added another step to test that dotnet command actually runs but I am still getting the error that dotnet command is not found.

I also tried to add DOTNET_ROOT env variable but to no avail!

Here is my yaml:

name: Pulumi
on:
  - pull_request
jobs:
  preview:
    name: Preview
    runs-on: ubuntu-latest
    steps:
      - name: Setup .net core
        uses: actions/setup-dotnet@v1
        with:
          dotnet-version: 3.0.100
      - name: Test .net core
        run: dotnet --version
      - name: Checkout repo
        uses: actions/checkout@v1
      - name: Execute pulumi preview
        uses: docker://pulumi/actions
        with:
          args: preview
        env:
          PULUMI_ROOT: ./infra
          DOTNET_ROOT: /opt/hostedtoolcache/dncs/3.0.100/x64      # This value is taken from "Test .net core" step
          PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
          PULUMI_CI: pr
          COMMENT_ON_PR: 1

Any help or guides would be appreciated. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.