suzuki-shunsuke/Lock Mechanism

Manage GitHub branch based lock mechanism

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
modeOne of the following values: - lock: Lock the key - unlock: Unlock the key - check: Check if the key is being locked yes
keyA lock key. This is useful to manage locks by service and environment. yes
remove_key_when_unlockEither "true" or "false". If this is "true", the key is removed when releasing the lock. If this is "false", all histories are kept. nofalse
key_prefixA lock key prefix. This action creates and updates the branch `${keyPrefix}${key}` for each key. nolock__
github_tokenGitHub Access Token. This is used to create branches and commits. The permission `contents:write` is required. no${{ github.token }}
repo_ownerThe repository owner where this action creates branches. The default value is `$GITHUB_REPOSITORY_OWNER`. no
repo_nameThe repository name where this action creates branches. The default value is the repository name of `$GITHUB_REPOSITORY`. no
messageThis is used to record the reason and context of lock and unlock operation. no
post_unlockIf this is `true`, the lock is released in a post step. nofalse
ignore_already_locked_errorIf this is `true`, the action does not fail when it can't acquire the lock as the key is already being locked. nofalse
max_wait_secondsThe maximum seconds to wait until the lock is released. no0
wait_interval_secondsThe interval seconds to check or try to acquire the lock. no30
fail_if_lockedFail if the key is already locked. This input is for `check` mode. nofalse
namedescription
lockedWhether the key is locked
already_lockedWhether the key is already locked. The difference between `already_locked` is that if `mode` is `lock` and the lock has already been acquired, `already_locked` is `true` but `locked` is `false`. And if the lock hasn't been acquired and the action can acquire a lock, `already_locked` is `false` but `locked` is `true`. If `mode` is `check`, there is no difference between `already_locked` and `locked`.
resultThe lock result