suzuki-shunsuke/Lock Mechanism
Manage GitHub branch based lock mechanism
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| mode | One of the following values: - lock: Lock the key - unlock: Unlock the key - check: Check if the key is being locked | yes | — |
| key | A lock key. This is useful to manage locks by service and environment. | yes | — |
| remove_key_when_unlock | Either "true" or "false". If this is "true", the key is removed when releasing the lock. If this is "false", all histories are kept. | no | false |
| key_prefix | A lock key prefix. This action creates and updates the branch `${keyPrefix}${key}` for each key. | no | lock__ |
| github_token | GitHub Access Token. This is used to create branches and commits. The permission `contents:write` is required. | no | ${{ github.token }} |
| repo_owner | The repository owner where this action creates branches. The default value is `$GITHUB_REPOSITORY_OWNER`. | no | — |
| repo_name | The repository name where this action creates branches. The default value is the repository name of `$GITHUB_REPOSITORY`. | no | — |
| message | This is used to record the reason and context of lock and unlock operation. | no | — |
| post_unlock | If this is `true`, the lock is released in a post step. | no | false |
| ignore_already_locked_error | If this is `true`, the action does not fail when it can't acquire the lock as the key is already being locked. | no | false |
| max_wait_seconds | The maximum seconds to wait until the lock is released. | no | 0 |
| wait_interval_seconds | The interval seconds to check or try to acquire the lock. | no | 30 |
| fail_if_locked | Fail if the key is already locked. This input is for `check` mode. | no | false |
Outputs
| name | description |
|---|---|
| locked | Whether the key is locked |
| already_locked | Whether 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`. |
| result | The lock result |