|
23 | 23 | repo: repository-name |
24 | 24 | owner: repository-owner |
25 | 25 | 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 |
28 | 28 |
|
29 | 29 | - name: Use the output run ID |
30 | 30 | run: echo ${{steps.return-dispatch.outputs.runId}} |
|
53 | 53 |
|
54 | 54 | 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. |
55 | 55 |
|
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). |
57 | 91 |
|
58 | 92 | ## Where does this help? |
59 | 93 |
|
|
0 commit comments