Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 33 additions & 37 deletions 00_core.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"outputs": [],
"source": [
"#export\n",
"_docroot = 'https://docs.github.com/en/free-pro-team@latest/rest/reference/'"
"_docroot = 'https://docs.github.com/rest/reference/'"
]
},
{
Expand Down Expand Up @@ -399,7 +399,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"GitHub has various [rate limits](https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#rate-limiting) for their API. After each call, the response includes information about how many requests are remaining in the hourly quota. If you'd like to add alerts, or indications showing current quota usage, you can register a callback with `GhApi` by passing a callable to the `limit_cb` parameter. This callback will be called whenever the amount of quota used changes. It will be called with two arguments: the new quota remaining, and the total hourly quota."
"GitHub has various [rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting) for their API. After each call, the response includes information about how many requests are remaining in the hourly quota. If you'd like to add alerts, or indications showing current quota usage, you can register a callback with `GhApi` by passing a callable to the `limit_cb` parameter. This callback will be called whenever the amount of quota used changes. It will be called with two arguments: the new quota remaining, and the total hourly quota."
]
},
{
Expand Down Expand Up @@ -508,41 +508,37 @@
{
"data": {
"text/markdown": [
"- [actions](https://docs.github.com/en/free-pro-team@latest/rest/reference/actions)\n",
"- [activity](https://docs.github.com/en/free-pro-team@latest/rest/reference/activity)\n",
"- [apps](https://docs.github.com/en/free-pro-team@latest/rest/reference/apps)\n",
"- [billing](https://docs.github.com/en/free-pro-team@latest/rest/reference/billing)\n",
"- [checks](https://docs.github.com/en/free-pro-team@latest/rest/reference/checks)\n",
"- [code_scanning](https://docs.github.com/en/free-pro-team@latest/rest/reference/code-scanning)\n",
"- [codes_of_conduct](https://docs.github.com/en/free-pro-team@latest/rest/reference/codes-of-conduct)\n",
"- [codespaces](https://docs.github.com/en/free-pro-team@latest/rest/reference/codespaces)\n",
"- [dependabot](https://docs.github.com/en/free-pro-team@latest/rest/reference/dependabot)\n",
"- [dependency_graph](https://docs.github.com/en/free-pro-team@latest/rest/reference/dependency-graph)\n",
"- [emojis](https://docs.github.com/en/free-pro-team@latest/rest/reference/emojis)\n",
"- [enterprise_admin](https://docs.github.com/en/free-pro-team@latest/rest/reference/enterprise-admin)\n",
"- [gists](https://docs.github.com/en/free-pro-team@latest/rest/reference/gists)\n",
"- [git](https://docs.github.com/en/free-pro-team@latest/rest/reference/git)\n",
"- [gitignore](https://docs.github.com/en/free-pro-team@latest/rest/reference/gitignore)\n",
"- [interactions](https://docs.github.com/en/free-pro-team@latest/rest/reference/interactions)\n",
"- [issues](https://docs.github.com/en/free-pro-team@latest/rest/reference/issues)\n",
"- [licenses](https://docs.github.com/en/free-pro-team@latest/rest/reference/licenses)\n",
"- [markdown](https://docs.github.com/en/free-pro-team@latest/rest/reference/markdown)\n",
"- [meta](https://docs.github.com/en/free-pro-team@latest/rest/reference/meta)\n",
"- [migrations](https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations)\n",
"- [oauth_authorizations](https://docs.github.com/en/free-pro-team@latest/rest/reference/oauth-authorizations)\n",
"- [oidc](https://docs.github.com/en/free-pro-team@latest/rest/reference/oidc)\n",
"- [orgs](https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs)\n",
"- [packages](https://docs.github.com/en/free-pro-team@latest/rest/reference/packages)\n",
"- [projects](https://docs.github.com/en/free-pro-team@latest/rest/reference/projects)\n",
"- [pulls](https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls)\n",
"- [rate_limit](https://docs.github.com/en/free-pro-team@latest/rest/reference/rate-limit)\n",
"- [reactions](https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions)\n",
"- [repos](https://docs.github.com/en/free-pro-team@latest/rest/reference/repos)\n",
"- [scim](https://docs.github.com/en/free-pro-team@latest/rest/reference/scim)\n",
"- [search](https://docs.github.com/en/free-pro-team@latest/rest/reference/search)\n",
"- [secret_scanning](https://docs.github.com/en/free-pro-team@latest/rest/reference/secret-scanning)\n",
"- [teams](https://docs.github.com/en/free-pro-team@latest/rest/reference/teams)\n",
"- [users](https://docs.github.com/en/free-pro-team@latest/rest/reference/users)"
"- [actions](https://docs.github.com/rest/reference/actions)\n",
"- [activity](https://docs.github.com/rest/reference/activity)\n",
"- [apps](https://docs.github.com/rest/reference/apps)\n",
"- [billing](https://docs.github.com/rest/reference/billing)\n",
"- [checks](https://docs.github.com/rest/reference/checks)\n",
"- [code_scanning](https://docs.github.com/rest/reference/code-scanning)\n",
"- [codes_of_conduct](https://docs.github.com/rest/reference/codes-of-conduct)\n",
"- [emojis](https://docs.github.com/rest/reference/emojis)\n",
"- [enterprise_admin](https://docs.github.com/rest/reference/enterprise-admin)\n",
"- [gists](https://docs.github.com/rest/reference/gists)\n",
"- [git](https://docs.github.com/rest/reference/git)\n",
"- [gitignore](https://docs.github.com/rest/reference/gitignore)\n",
"- [interactions](https://docs.github.com/rest/reference/interactions)\n",
"- [issues](https://docs.github.com/rest/reference/issues)\n",
"- [licenses](https://docs.github.com/rest/reference/licenses)\n",
"- [markdown](https://docs.github.com/rest/reference/markdown)\n",
"- [meta](https://docs.github.com/rest/reference/meta)\n",
"- [migrations](https://docs.github.com/rest/reference/migrations)\n",
"- [oauth_authorizations](https://docs.github.com/rest/reference/oauth-authorizations)\n",
"- [orgs](https://docs.github.com/rest/reference/orgs)\n",
"- [packages](https://docs.github.com/rest/reference/packages)\n",
"- [projects](https://docs.github.com/rest/reference/projects)\n",
"- [pulls](https://docs.github.com/rest/reference/pulls)\n",
"- [rate_limit](https://docs.github.com/rest/reference/rate-limit)\n",
"- [reactions](https://docs.github.com/rest/reference/reactions)\n",
"- [repos](https://docs.github.com/rest/reference/repos)\n",
"- [scim](https://docs.github.com/rest/reference/scim)\n",
"- [search](https://docs.github.com/rest/reference/search)\n",
"- [secret_scanning](https://docs.github.com/rest/reference/secret-scanning)\n",
"- [teams](https://docs.github.com/rest/reference/teams)\n",
"- [users](https://docs.github.com/rest/reference/users)"
],
"text/plain": [
"<__main__.GhApi at 0x11e204eb0>"
Expand Down
18 changes: 9 additions & 9 deletions 01_actions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@
" CONTEXT_GITHUB: ${{ toJson(github) }}\n",
"```\n",
"\n",
"This stores the full [github context](https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#github-context), which includes information such as the name of the current workflow being run, the GitHub access token, and so forth.\n",
"This stores the full [github context](https://docs.github.com/actions/reference/context-and-expression-syntax-for-github-actions#github-context), which includes information such as the name of the current workflow being run, the GitHub access token, and so forth.\n",
"\n",
"As well as the `github` context, you can do that same thing for any of the other GitHub Actions contexts, which are:\n",
"\n",
"`github` `env` `job` `steps` `runner` `secrets` `strategy` `matrix` `needs`\n",
"\n",
"For instance, for the [needs](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idneeds) context, information about previous jobs specified in your `needs` clause, add this underneath your `CONTEXT_GITHUB` line:\n",
"For instance, for the [needs](https://docs.github.com/actions/reference/workflow-syntax-for-github-actions#jobsjob_idneeds) context, information about previous jobs specified in your `needs` clause, add this underneath your `CONTEXT_GITHUB` line:\n",
"\n",
"```bash\n",
" CONTEXT_NEEDS: ${{ toJson(needs) }}\n",
Expand Down Expand Up @@ -107,7 +107,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"GitHub also adds a number of [`GITHUB_*` environment variables](https://docs.github.com/en/free-pro-team@latest/actions/reference/environment-variables#default-environment-variables) to all runners. These are available through the `env_github` `AttrDict`, with the `GITHUB_` prefix removed, and remainder converted to lowercase. For instance:"
"GitHub also adds a number of [`GITHUB_*` environment variables](https://docs.github.com/actions/reference/environment-variables#default-environment-variables) to all runners. These are available through the `env_github` `AttrDict`, with the `GITHUB_` prefix removed, and remainder converted to lowercase. For instance:"
]
},
{
Expand Down Expand Up @@ -528,7 +528,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Details in the [GitHub Documentation for `set-output`](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter)."
"Details in the [GitHub Documentation for `set-output`](https://docs.github.com/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter)."
]
},
{
Expand All @@ -547,7 +547,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Details in the [GitHub Documentation for `debug`](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-debug-message). Note that you must create a secret named `ACTIONS_STEP_DEBUG` with the value true to see the debug messages set by this command in the log."
"Details in the [GitHub Documentation for `debug`](https://docs.github.com/actions/reference/workflow-commands-for-github-actions#setting-a-debug-message). Note that you must create a secret named `ACTIONS_STEP_DEBUG` with the value true to see the debug messages set by this command in the log."
]
},
{
Expand All @@ -566,7 +566,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Details in the [GitHub Documentation for `warning`](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message). For the optional `details`, you can provide comma-delimited file, line, and column information, e.g.: `file=app.js,line=1,col=5`."
"Details in the [GitHub Documentation for `warning`](https://docs.github.com/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message). For the optional `details`, you can provide comma-delimited file, line, and column information, e.g.: `file=app.js,line=1,col=5`."
]
},
{
Expand All @@ -585,7 +585,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Details in the [GitHub Documentation for `error`](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-error-message). For the optional `details`, you can provide comma-delimited file, line, and column information, e.g.: `file=app.js,line=1,col=5`."
"Details in the [GitHub Documentation for `error`](https://docs.github.com/actions/reference/workflow-commands-for-github-actions#setting-an-error-message). For the optional `details`, you can provide comma-delimited file, line, and column information, e.g.: `file=app.js,line=1,col=5`."
]
},
{
Expand Down Expand Up @@ -626,7 +626,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Details in the GitHub Documentation for [grouping log lines](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#grouping-log-lines)."
"Details in the GitHub Documentation for [grouping log lines](https://docs.github.com/actions/reference/workflow-commands-for-github-actions#grouping-log-lines)."
]
},
{
Expand All @@ -645,7 +645,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Details in the [GitHub Documentation for `add-mask`](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#masking-a-value-in-log)."
"Details in the [GitHub Documentation for `add-mask`](https://docs.github.com/actions/reference/workflow-commands-for-github-actions#masking-a-value-in-log)."
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion 03_page.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Some GitHub API operations return their results one page at a time. For instance, there are many thousands of [gists](https://docs.github.com/en/free-pro-team@latest/github/writing-on-github/creating-gists), but if we call `list_public` we only see the first 30:"
"Some GitHub API operations return their results one page at a time. For instance, there are many thousands of [gists](https://docs.github.com/github/writing-on-github/creating-gists), but if we call `list_public` we only see the first 30:"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions 10_cli.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"You can use `GhApi` via the command line, and can access nearly everything in the [GitHub API](https://docs.github.com/en/free-pro-team@latest/rest).\n",
"You can use `GhApi` via the command line, and can access nearly everything in the [GitHub API](https://docs.github.com/rest).\n",
"\n",
"There are three commands provided. For most people, `ghapi` will be the easiest to use. All three commands take the following parameters:\n",
"\n",
Expand All @@ -61,7 +61,7 @@
"source": [
"To get started with the `ghapi` command, first find the name of the operation you wish to perform. If you've used the Python API, then you already know the operation names - they're whatever you type in Python after \"`api.`\". To find the name of the operation you need, search the [full API reference](https://ghapi.fast.ai/fullapi.html) which contains information about every endpoint in the entire GitHub API. For instance, if you want to work with GitHub Issues, then searching for \"issues\" on the full reference page will take you to [this section](https://ghapi.fast.ai/fullapi.html#issues).\n",
"\n",
"The first operation listed there is [issues.list](https://docs.github.com/en/free-pro-team@latest/rest/reference/issues#list-issues-assigned-to-the-authenticated-user), shown with a link to the official GitHub documentation, and a list of parameters that the command accepts. You'll see the official docs list some parameters, such as \"`accept`\", which aren't listed in the GhApi reference - that's because GhApi automatically set some parameters for you.\n",
"The first operation listed there is [issues.list](https://docs.github.com/rest/reference/issues#list-issues-assigned-to-the-authenticated-user), shown with a link to the official GitHub documentation, and a list of parameters that the command accepts. You'll see the official docs list some parameters, such as \"`accept`\", which aren't listed in the GhApi reference - that's because GhApi automatically set some parameters for you.\n",
"\n",
"You'll also see that the parameter list on the official docs includes a column marked \"**in**\", which can be \"header\", \"query\", \"path\", or \"body\". The `ghapi` command handles that distinction for you, so you can ignore it for now."
]
Expand Down Expand Up @@ -226,7 +226,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"If you find the endpoint you want in the GitHub docs, rather than the GhApi reference, you'll see a `path` and a `verb` instead of an operation name. For example, here's the GitHub documentation for [git.getref](https://docs.github.com/en/free-pro-team@latest/rest/reference/git#get-a-reference). The white text on blue background section shows that the verb required is \"`GET`\". Next to that is the path, which is listed as \"`/repos/{owner}/{repo}/git/ref/{ref}`\".\n",
"If you find the endpoint you want in the GitHub docs, rather than the GhApi reference, you'll see a `path` and a `verb` instead of an operation name. For example, here's the GitHub documentation for [git.getref](https://docs.github.com/rest/reference/git#get-a-reference). The white text on blue background section shows that the verb required is \"`GET`\". Next to that is the path, which is listed as \"`/repos/{owner}/{repo}/git/ref/{ref}`\".\n",
"\n",
"To call an endpoint when you have this information from the GitHub docs, use the `ghpath` command. The arguments are exactly the same as `ghapi`, except that instead of an operation name, you provide the path (which you can paste directly from the GitHub docs) and verb."
]
Expand Down
Loading