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

feature: add ignoreNotFound option #518

Merged
merged 2 commits into from
Feb 1, 2024
Merged

Conversation

fairclothjm
Copy link
Contributor

@fairclothjm fairclothjm commented Jan 31, 2024

Description

Add ignoreNotFound input (default: false) to prevent the action from failing when a secret does not exist

Supercedes #506

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

@fairclothjm fairclothjm requested a review from a team January 31, 2024 22:37
notFoundMsg = `Unable to retrieve result for "${path}" because it was not found: ${response.body.trim()}`;
const ignoreNotFound = (core.getInput('ignoreNotFound', { required: false }) || 'false').toLowerCase() != 'false';
if (ignoreNotFound) {
core.error(`✘ ${notFoundMsg}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

No strong opinion but I can see this being a warning instead of an error since the input flag tells us a missing secret is acceptable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about this a bit and since it is an error returned by Vault I think I will keep it as an error in the action. Thanks @maxcoulombe !

Copy link
Contributor

@maxcoulombe maxcoulombe left a comment

Choose a reason for hiding this comment

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

Nice!

@fairclothjm fairclothjm merged commit efab57e into main Feb 1, 2024
6 checks passed
@fairclothjm fairclothjm deleted the feat/continue-on-not-found branch February 1, 2024 14:42
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.

2 participants