Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 3 commits into from
Closed

Conversation

tanguy-platsec
Copy link

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
Copy link

hashicorp-cla commented Nov 27, 2023

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
Copy link

kpcraig commented Dec 6, 2023

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
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
Contributor

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

@tanguy-platsec
Copy link
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
Copy link
Contributor

fairclothjm commented Feb 6, 2024

@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