You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/actions/createOrUpdateOrgSecret.md
+69-4Lines changed: 69 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,16 +8,81 @@ type: API method
8
8
9
9
# Create or update an organization secret
10
10
11
-
Creates or updates an organization secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.
11
+
Creates or updates an organization secret with an encrypted value. Encrypt your secret using
12
+
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access
13
+
token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to
14
+
use this endpoint.
15
+
16
+
#### Example encrypting a secret using Node.js
12
17
13
18
Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.
14
19
20
+
```
21
+
const sodium = require('tweetsodium');
22
+
23
+
const key = "base64-encoded-public-key";
24
+
const value = "plain-text-secret";
25
+
26
+
// Convert the message and key to Uint8Array's (Buffer implements that interface)
Copy file name to clipboardExpand all lines: docs/actions/createOrUpdateRepoSecret.md
+66-1Lines changed: 66 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,16 +8,81 @@ type: API method
8
8
9
9
# Create or update a repository secret
10
10
11
-
Creates or updates a repository secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint.
11
+
Creates or updates a repository secret with an encrypted value. Encrypt your secret using
12
+
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access
13
+
token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use
14
+
this endpoint.
15
+
16
+
#### Example encrypting a secret using Node.js
12
17
13
18
Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.
14
19
20
+
```
21
+
const sodium = require('tweetsodium');
22
+
23
+
const key = "base64-encoded-public-key";
24
+
const value = "plain-text-secret";
25
+
26
+
// Convert the message and key to Uint8Array's (Buffer implements that interface)
Copy file name to clipboardExpand all lines: docs/actions/createRegistrationTokenForOrg.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,10 +10,17 @@ type: API method
10
10
11
11
**Warning:** The self-hosted runners API for organizations is currently in public beta and subject to change.
12
12
13
-
Returns a token that you can pass to the `config` script. The token expires after one hour. You must authenticate using an access token with the `admin:org` scope to use this endpoint.
13
+
Returns a token that you can pass to the `config` script. The token expires after one hour. You must authenticate
14
+
using an access token with the `admin:org` scope to use this endpoint.
15
+
16
+
#### Example using registration token
14
17
15
18
Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint.
Copy file name to clipboardExpand all lines: docs/actions/createRegistrationTokenForRepo.md
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,16 @@ type: API method
8
8
9
9
# Create a registration token for a repository
10
10
11
-
Returns a token that you can pass to the `config` script. The token expires after one hour. You must authenticate using an access token with the `repo` scope to use this endpoint.
11
+
Returns a token that you can pass to the `config` script. The token expires after one hour. You must authenticate
12
+
using an access token with the `repo` scope to use this endpoint.
12
13
13
-
Configure your self-hosted runner, replacing TOKEN with the registration token provided by this endpoint.
14
+
#### Example using registration token
15
+
16
+
Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint.
Copy file name to clipboardExpand all lines: docs/actions/createRemoveTokenForOrg.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,18 @@ type: API method
10
10
11
11
**Warning:** The self-hosted runners API for organizations is currently in public beta and subject to change.
12
12
13
-
Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour. You must authenticate using an access token with the `admin:org` scope to use this endpoint.
13
+
Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The
14
+
token expires after one hour. You must authenticate using an access token with the `admin:org` scope to use this
15
+
endpoint.
14
16
15
-
To remove your self-hosted runner from an organization, replace `TOKEN` with the remove token provided by this endpoint.
17
+
#### Example using remove token
18
+
19
+
To remove your self-hosted runner from an organization, replace `TOKEN` with the remove token provided by this
Copy file name to clipboardExpand all lines: docs/actions/createRemoveTokenForRepo.md
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,16 @@ type: API method
8
8
9
9
# Create a remove token for a repository
10
10
11
-
Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour. You must authenticate using an access token with the `repo` scope to use this endpoint.
11
+
Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour.
12
+
You must authenticate using an access token with the `repo` scope to use this endpoint.
12
13
13
-
Remove your self-hosted runner from a repository, replacing TOKEN with the remove token provided by this endpoint.
14
+
#### Example using remove token
15
+
16
+
To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint.
route: POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches
5
+
scope: actions
6
+
type: API method
7
+
---
8
+
9
+
# Create a workflow dispatch event
10
+
11
+
You can use this endpoint to manually trigger a GitHub Actions workflow run. You can also replace `{workflow_id}` with the workflow file name. For example, you could use `main.yml`.
12
+
13
+
You must configure your GitHub Actions workflow to run when the [`workflow_dispatch` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The `inputs` are configured in the workflow file. For more information about how to configure the `workflow_dispatch` event in the workflow file, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)."
14
+
15
+
You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)."
16
+
17
+
```js
18
+
octokit.actions.createWorkflowDispatch({
19
+
owner,
20
+
repo,
21
+
workflow_id,
22
+
ref,
23
+
});
24
+
```
25
+
26
+
## Parameters
27
+
28
+
<table>
29
+
<thead>
30
+
<tr>
31
+
<th>name</th>
32
+
<th>required</th>
33
+
<th>description</th>
34
+
</tr>
35
+
</thead>
36
+
<tbody>
37
+
<tr><td>owner</td><td>yes</td><td>
38
+
39
+
</td></tr>
40
+
<tr><td>repo</td><td>yes</td><td>
41
+
42
+
</td></tr>
43
+
<tr><td>workflow_id</td><td>yes</td><td>
44
+
45
+
</td></tr>
46
+
<tr><td>ref</td><td>yes</td><td>
47
+
48
+
The reference of the workflow run. The reference can be a branch, tag, or a commit SHA.
49
+
50
+
</td></tr>
51
+
<tr><td>inputs</td><td>no</td><td>
52
+
53
+
Input keys and values configured in the workflow file. The maximum number of properties is 10.
54
+
55
+
</td></tr>
56
+
<tr><td>inputs.*</td><td>no</td><td>
57
+
58
+
</td></tr>
59
+
</tbody>
60
+
</table>
61
+
62
+
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/actions/workflows/#create-a-workflow-dispatch-event).
Copy file name to clipboardExpand all lines: docs/actions/downloadArtifact.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,10 @@ type: API method
8
8
9
9
# Download an artifact
10
10
11
-
Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in the response header to find the URL for the download. The `:archive_format` must be `zip`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.
12
-
13
-
Call this endpoint using the `-v` flag, which enables verbose output and allows you to see the download URL in the header. To download the file into the current working directory, specify the filename using the `-o` flag.
11
+
Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in
12
+
the response header to find the URL for the download. The `:archive_format` must be `zip`. Anyone with read access to
13
+
the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope.
14
+
GitHub Apps must have the `actions:read` permission to use this endpoint.
Copy file name to clipboardExpand all lines: docs/actions/downloadJobLogsForWorkflowRun.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,10 @@ type: API method
8
8
9
9
# Download job logs for a workflow run
10
10
11
-
Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look for `Location:` in the response header to find the URL for the download. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.
12
-
13
-
Call this endpoint using the `-v` flag, which enables verbose output and allows you to see the download URL in the header. To download the file into the current working directory, specify the filename using the `-o` flag.
11
+
Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look
12
+
for `Location:` in the response header to find the URL for the download. Anyone with read access to the repository can
13
+
use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must
14
+
have the `actions:read` permission to use this endpoint.
0 commit comments