Skip to content

feature: add ignoreNotFound option#518

Merged
fairclothjm merged 2 commits intomainfrom
feat/continue-on-not-found
Feb 1, 2024
Merged

feature: add ignoreNotFound option#518
fairclothjm merged 2 commits intomainfrom
feat/continue-on-not-found

Conversation

@fairclothjm
Copy link
Copy Markdown
Collaborator

@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
Copy Markdown
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
Copy Markdown
Collaborator 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
Copy Markdown
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!

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