Skip to content

feat(): make secrets parameter optional#299

Merged
tomhjp merged 3 commits into
hashicorp:masterfrom
kevinschoonover:master
Apr 7, 2022
Merged

feat(): make secrets parameter optional#299
tomhjp merged 3 commits into
hashicorp:masterfrom
kevinschoonover:master

Conversation

@kevinschoonover

@kevinschoonover kevinschoonover commented Mar 5, 2022

Copy link
Copy Markdown
Contributor

closes #289

tested this PR locally using act

@kevinschoonover
kevinschoonover marked this pull request as ready for review March 5, 2022 22:18
@hashicorp-cla

hashicorp-cla commented Mar 12, 2022

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@TomNorth

TomNorth commented Apr 5, 2022

Copy link
Copy Markdown
Contributor

Will this get merged soon? If not I need to create my own action in the next couple of days, but I'd rather avoid it! For my own testing I can just use continue-on-error in the workflow, but I'm putting together to be broadly consumed by engineers across the org, so that's not viable going forward.

(Thanks for this)

@kevinschoonover

Copy link
Copy Markdown
Contributor Author

I need a hashicorp maintainer to approve before it can be merged.

@tvoran do you have any cycles to take a look / is there any interest in this change?

@tomhjp tomhjp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this. LGTM, although I'm not keen on maintaining yarn.lock alongside package-lock.json unless we get some infrastructure around keeping them in sync (e.g. some kind of CI to ensure yarn import gives a consistent result?). Could you delete it for now please?

@kevinschoonover

Copy link
Copy Markdown
Contributor Author

Sorry about that! Should be done now.

@tomhjp tomhjp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Sorry I forgot to mention in the previous comment, please could we also add a test? To help me verify, I wrote a little unit test, and you can just use this in action.test.js if you like:

it('export only Vault token, no secrets', async () => {
    mockExportToken("true")

    await exportSecrets();

    expect(core.exportVariable).toBeCalledTimes(1);
    expect(core.exportVariable).toBeCalledWith('VAULT_TOKEN', 'EXAMPLE');
});

@tomhjp tomhjp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Make secrets parameter optional so we can use this action just to get the token.

6 participants