Skip to content

feat: add new ignoreNotFound input to prevent the action from crashing when requested secrets do not exist#506

Closed
tanguy-platsec wants to merge 3 commits into
hashicorp:mainfrom
tanguy-platsec:handle-ignoreNotFound-input
Closed

feat: add new ignoreNotFound input to prevent the action from crashing when requested secrets do not exist#506
tanguy-platsec wants to merge 3 commits into
hashicorp:mainfrom
tanguy-platsec:handle-ignoreNotFound-input

Conversation

@tanguy-platsec

Copy link
Copy Markdown

Description

Adding an optional input ignoreNotFound to make the action keep going even though one of the requested secret is not found (404).

We have a specific case where this is useful (necessary to be honest) and we thought it would be a nice improvement to your action codebase, since it is sometimes wanted to have a "always exit success" mecanism in GitHub Actions ecosystem.

Let me know what you think! Of course I can adapt my changes to whatever you prefer, like passing the new input variable from action.js to the getSecrets function instead of importing core in the secrets.js file (wasn't sure what was the best practice there).

Checklist

  • Added CHANGELOG entry (only for user-facing changes)
  • Did not commit changes to dist/index.js (This is only done for releases by vault-action maintainers)

Community Note

  • Please vote on this pull request by adding a 👍
    reaction
    to the original pull request comment to help the community and maintainers
    prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request
    followers and do not help prioritize the request

@hashicorp-cla

hashicorp-cla commented Nov 27, 2023

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@tanguy-platsec tanguy-platsec changed the title feat: add new ignoreNotFound input to make the secrets not crash when requested secrets do not exist feat: add new ignoreNotFound input to prevent the action from crashing when requested secrets do not exist Nov 27, 2023
@kpcraig

kpcraig commented Dec 6, 2023

Copy link
Copy Markdown
Collaborator

hey @tanguy-platsec, thanks for the PR! Is there an obvious way to add a test for this new scenario? Other than that it looks good to me!

@tanguy-platsec

Copy link
Copy Markdown
Author

Hello again!
We found a way to fix our issue without this patch.
Honestly I tried adding tests but I am not sure what you expect from them and I am having a hard time writing some so I think I will not put any more time on this, sorry about this!
Feel free to close this pull request if you want.

@fairclothjm

Copy link
Copy Markdown
Collaborator

@tanguy-platsec I am curious what your workaround was?

@tanguy-platsec

Copy link
Copy Markdown
Author

@tanguy-platsec I am curious what your workaround was?

We simply list the secrets' paths we want to load in a YAML file and we parse it during CI to load them.
If we get a 404 then it's because we made a mistake in the config file :)
It's more painful but also more explicit.

@fairclothjm

fairclothjm commented Feb 6, 2024

Copy link
Copy Markdown
Collaborator

@fairclothjm fairclothjm closed this Feb 6, 2024
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.

4 participants