Escape-Technologies / mookme

A pre-commit tool designed for monorepos.
MIT License
99 stars 16 forks source link

Credentials/Secrets store #104

Open benedikt-bartscher opened 1 year ago

benedikt-bartscher commented 1 year ago

Some typical pre-commit tasks, for example validation of .gitlab-ci.yml files, require auth to an external server. We should think about a global config file to store those secrets per-machine.

LMaxence commented 1 year ago

Hello there !

I understand that this might be good add-on within Mookme, but it also feels to me like it is not up to the hooks manager to provide the correct hook execution environment.

In your specific case of a Gitlab CI, you can (and, probably, should) use the CI secrets feature to provide an environment. Afterwards, regardless of if the tool reads that environment on his own, or if you have to provide it in the command line invokation, you could provide it with nothing more within Mookme:

# CI secret
MY_SECRET=<SOMETHING>

-> pre-commit.json

{ 
  "steps": [{
    "name": "Something very very secret",
    "scripts": "do-something --secret=$MY_SECRET"
  }]
}

Hope that helps !