Write the secrets of a project's environments: set, import, copy, restore, rename or delete keys. No value is echoed back; to read values use reveal_values or pull_env.
Project-level fields go through manage_projects action set_field, whole files through manage_files.
Actions (arguments besides action and project):
- set (environment, key, value; optional kind, note, expectedVersion): creates the key or replaces its value; kind and note stay unless passed. Use version from list_project_items item secrets or current from find_secret_keys action history as expectedVersion. Refresh it after a conflict before deciding whether to retry.
- import (environment, text; optional overwrite, kind): many keys from dotenv text.
- copy (from, to; optional keys, overwrite): between environments, without the values passing through you. Run find_secret_keys action diff first.
- restore (environment, key, version): makes a version from find_secret_keys action history current.
- rename (environment, key, newKey): same value, kind and note under a new name; the version goes up by one.
- delete (environment, key): removes the key and its whole history permanently; restore cannot bring it back.
A replaced value always stays in the key's history. import and copy skip existing keys unless overwrite is true. Protected and sealed keys are refused by set, restore, rename and delete, and skipped and named by import and copy.
Errors are messages: a write that lost a race ends with "read it again and retry"; a rename onto a used name says "already exists in this environment"; an unknown key fails restore, rename and delete; where billing is on, an organisation not on Pro writes nothing.
Audited with key names only. Needs secrets:write and the editor role; copy, restore and rename also secrets:read.