https://github.com/actions-cool/check-user-permission
๐ฎ A GitHub Action to check user permission of the current repository.
https://github.com/actions-cool/check-user-permission
check github-actions permission user
Last synced: 10 months ago
JSON representation
๐ฎ A GitHub Action to check user permission of the current repository.
- Host: GitHub
- URL: https://github.com/actions-cool/check-user-permission
- Owner: actions-cool
- License: mit
- Created: 2021-03-04T13:35:08.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-01-07T08:18:36.000Z (over 1 year ago)
- Last Synced: 2025-07-30T01:13:21.967Z (11 months ago)
- Topics: check, github-actions, permission, user
- Language: JavaScript
- Homepage:
- Size: 422 KB
- Stars: 20
- Watchers: 1
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ฎ Check User Permission

[](https://github.com/marketplace/actions/check-user-permission)
[](https://github.com/actions-cool/check-user-permission/releases)
## ๐ How to use?
```yml
name: Check User Permission
on:
issues:
types: [opened, edited]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions-cool/check-user-permission@v2
```
### Input
| Name | Desc | Type | Required |
| -- | -- | -- | -- |
| token | GitHub token | string | โ |
| require | Test whether the user meets the required permission | string | โ |
| username | Obtained from the context by default, can also be customized to pass in | string | โ |
| check-bot | Check whether the user is a bot | boolean | โ |
| check-contributor | Check whether the user is contributor | boolean | โ |
| error-if-missing | Error if require or check if false | boolean | โ |
- User permission: `admin` > `write` > `read`
- `username` support [github context](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context)
- `actor`: The Default
- `triggering_actor`: The username of the user that initiated the workflow run even re-run
- Example: `username: github.triggering_actor`
### Output
- `user-permission`: `read` | `write` | `admin`
- `require-result`: The result of require `true` | `false`
- `check-result`: The result of check `true` | `false`
> How to use?
> - https://github.com/actions-cool/issues-helper#outputs-%E4%BD%BF%E7%94%A8
> - https://github.com/actions-cool/check-user-permission/blob/main/.github/workflows/check-permission.yml
> - https://github.com/actions-cool/test-ci/blob/main/.github/workflows/test-check-user.yml
## โก Feedback
You are very welcome to try it out and put forward your comments. You can use the following methods:
- Report bugs or consult with [Issue](https://github.com/actions-cool/check-user-permissionissues)
- Submit [Pull Request](https://github.com/actions-cool/check-user-permission/pulls) to improve the code of `check-user-permission`
ๆฌข่ฟๅ ๅ
ฅ ้้ไบคๆต็พค

## Changelog
[CHANGELOG](./CHANGELOG.md)
## LICENSE
[MIT](./LICENSE)