Skip to content

Commit 21c484f

Browse files
committed
Improve documentation.
1 parent 41635c4 commit 21c484f

File tree

1 file changed

+37
-3
lines changed

1 file changed

+37
-3
lines changed

README.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ steps:
2323
repo: repository-name
2424
owner: repository-owner
2525
workflow: automation-test.yml
26-
workflow_inputs: { "some_input": "value" }
27-
workflow_timeout_seconds: 300
26+
workflow_inputs: { "some_input": "value" } # Optional
27+
workflow_timeout_seconds: 60 # Default: 300
2828

2929
- name: Use the output run ID
3030
run: echo ${{steps.return-dispatch.outputs.runId}}
@@ -53,7 +53,41 @@ jobs:
5353

5454
To be able to use dispatch we need to use a token which has `repo` permissions. `GITHUB_TOKEN` currently does not allow adding permissions for `repo` level permissions currently so a Personal Access Token (PAT) must be used.
5555

56-
The scope required to dispatch the action is `repo:public_repo` or `repo` if the repository is private.
56+
### Permissions Required
57+
58+
The permissions required for this action to function correctly are:
59+
60+
- `repo` scope
61+
- You may get away with simply having `repo:public_repo`
62+
- `repo` is definitely needed if the repository is private.
63+
- `actions:read`
64+
- `actions:write`
65+
66+
### APIs Used
67+
68+
For the sake of transparency please note that this action uses the following API calls:
69+
70+
- [Create a workflow dispatch event](https://docs.github.com/en/rest/reference/actions#create-a-workflow-dispatch-event)
71+
- POST `/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches`
72+
- Permissions:
73+
- `repo`
74+
- `actions:write`
75+
- [List repository workflows](https://docs.github.com/en/rest/reference/actions#list-repository-workflows)
76+
- GET `/repos/{owner}/{repo}/actions/workflows`
77+
- Permissions:
78+
- `repo`
79+
- `actions:read`
80+
- [List workflow runs](https://docs.github.com/en/rest/reference/actions#list-workflow-runs)
81+
- GET `/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs`
82+
- Permissions:
83+
- `repo`
84+
- [Download workflow run logs](https://docs.github.com/en/rest/reference/actions#download-workflow-run-logs)
85+
- GET `/repos/{owner}/{repo}/actions/runs/{run_id}/logs`
86+
- Permissions:
87+
- `repo`
88+
- `actions:read`
89+
90+
For more information please see [api.ts](./src/api.ts).
5791

5892
## Where does this help?
5993

0 commit comments

Comments
 (0)