pulumi / actions

Deploy continuously to your cloud of choice, using your favorite language, Pulumi, and GitHub!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pulumi action tries to login to pulumi cloud even though we're using S3 backend

annStein opened this issue · comments

What happened?

The pulumi action version 5.1.0 tries to login to pulumi cloud backend instead of the configured S3 backend. It is working fine with version 5.0.0.

Example

Run pulumi/actions@v5
  with:
    command: preview
    stack-name: <XXX>
    work-dir: <XXX>
    pulumi-version: <XXX>
    comment-on-pr: false
    comment-on-summary: false
    github-token: ***
    expect-no-changes: false
    diff: false
    target-dependents: false
    refresh: false
    upsert: false
    remove: false
    edit-pr-comment: true
    color: auto
    exclude-protected: false
  env:
    IMAGE_NAME: <XXX>    
    NPM_CONFIG_USERCONFIG: /home/runner/work/_temp/.npmrc
    NODE_AUTH_TOKEN: XXXXX-XXXXX-XXXXX-XXXXX
    AWS_DEFAULT_REGION: eu-central-1
    AWS_REGION: eu-central-1
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: ***
    AWS_SESSION_TOKEN: ***
Configured range: ^3
/usr/local/bin/pulumi version
v3.101.1
Pulumi version 3.101.1 is already installed on this machine. Skipping download
Logging into the Pulumi Cloud backend.

/home/runner/work/_actions/pulumi/actions/v5/webpack:/pulumi-github-action/node_modules/tslib/tslib.js:115
            function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
^
Error: error: problem logging in: PULUMI_ACCESS_TOKEN must be set for login during non-interactive CLI sessions
    at /home/runner/work/_actions/pulumi/actions/v5/webpack:/pulumi-github-action/src/main.ts:[4](<XXX>)7:1
    at Generator.next (<anonymous>)
    at fulfilled (/home/runner/work/_actions/pulumi/actions/v[5](<XXX>)/webpack:/pulumi-github-action/node_modules/tslib/tslib.js:115:1)
    at processTicksAndRejections (node:internal/process/task_queues:[9](<XXX>)5:5)

Output of pulumi about

Does not apply since pulumi-action is used and pulumi about is not available in action.

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

the configured S3 backend.

What configured S3 backend? The config shown doesn't list backend.

I think you need to set the 'cloud-url' config option. Not sure how this was ever working before.

We don't pass the cloud-url since it's defined in the Pulumi.yaml

backend:
  url: s3://<XXX>

We are facing the same issue even with the cloud-url property correctly set. We end up downgrading to v5 which works just fine.

image

We don't pass the cloud-url since it's defined in the Pulumi.yaml

Ah... yes that's a regression.

We are facing the same issue

I think that might be a different issue. The old code ignored any error from login so this would have been silently failing. Although again not clear how this was working before if login was failing.

What do you mean with login failing? The preview or update commands where executing fine and the state in the cloud was updated properly. Maybe I'm missing something else?

I know this new implementation show the error, but is there any way to check this login issues within the v5.0.0 action?

What do you mean with login failing?

As in pulumi login failing. Oddly the login flow for that and preview are the same as far as I can see so I'm not sure how this is in a state where login fails but preview was working.

I don't think the old action recorded these failures in any way. Doesn't even look like debug mode logs anything for exec calls. We'll get a fix out so this doesn't hard error.

I just released v5.1.1 of the GitHub action, which should solve this.