Skip to content

Commit

Permalink
add README
Browse files Browse the repository at this point in the history
  • Loading branch information
74th committed Oct 4, 2020
1 parent ec1704f commit b7f03eb
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Github action to control workflow permissions

Event workflow_dispatch is able to start workflows manually.
This action will fail when workflow is started by not permitted users.

![](workflow_dispatch.png)

![](not_permitted.png)

## Input

- users: permitted user names (separated by ,)
- listfile: permitted user list file path (separated by line feed \\n)

## Sample1 list users on workflow file

```yaml
# .github/workflows/deploy.yml
name: deploy
on:
workflow_dispatch: {}

jobs:
deploy:
runs-on: ubuntu-20.04
name: deploy test
steps:
- name: check user permission
uses: 74th/[email protected]
with:
users: user76th,user77th,user78th
- name: deploy
run: echo "deployed"
```
## Sample2 using list file on repository
.github/workflows/prod-deploy-user
```
user76th
user77th
user78th
```

```yaml
# .github/workflows/deploy.yml
name: deploy
on:
workflow_dispatch: {}

jobs:
deploy:
runs-on: ubuntu-20.04
name: deploy test
steps:
- uses: actions/checkout@v2
- name: check user permission
uses: 74th/[email protected]
with:
listfile: .github/workflows/prod-deploy-user
- name: deploy
run: echo "deployed"
```
Binary file added not_permitted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added workflow_dispatch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b7f03eb

Please sign in to comment.