Skip to content

๐Ÿ‘ฎ A GitHub Action to check user permission of the current repository.

License

Notifications You must be signed in to change notification settings

actions-cool/check-user-permission

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

๐Ÿ‘ฎ Check User Permission

๐Ÿš€ How to use?

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
    • 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?

โšก 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
  • Submit Pull Request to improve the code of check-user-permission

ๆฌข่ฟŽๅŠ ๅ…ฅ ้’‰้’‰ไบคๆต็พค

Changelog

CHANGELOG

LICENSE

MIT