diff --git a/00_core.ipynb b/00_core.ipynb index a820420..52d8ba9 100644 --- a/00_core.ipynb +++ b/00_core.ipynb @@ -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/'" ] }, { @@ -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." ] }, { @@ -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>" diff --git a/01_actions.ipynb b/01_actions.ipynb index 842443d..4d4c2cf 100644 --- a/01_actions.ipynb +++ b/01_actions.ipynb @@ -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", @@ -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:" ] }, { @@ -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)." ] }, { @@ -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." ] }, { @@ -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`." ] }, { @@ -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`." ] }, { @@ -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)." ] }, { @@ -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)." ] }, { diff --git a/03_page.ipynb b/03_page.ipynb index 2f8e460..e2c1fc7 100644 --- a/03_page.ipynb +++ b/03_page.ipynb @@ -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:" ] }, { diff --git a/10_cli.ipynb b/10_cli.ipynb index c3a79bc..1c360fd 100644 --- a/10_cli.ipynb +++ b/10_cli.ipynb @@ -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", @@ -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." ] @@ -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." ] diff --git a/80_tutorial_actions.ipynb b/80_tutorial_actions.ipynb index 95aab3c..a2f039a 100644 --- a/80_tutorial_actions.ipynb +++ b/80_tutorial_actions.ipynb @@ -18,11 +18,11 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "[GitHub Actions](https://docs.github.com/en/free-pro-team@latest/actions) help you automate tasks within your software development life cycle. GitHub say that:\n", + "[GitHub Actions](https://docs.github.com/actions) help you automate tasks within your software development life cycle. GitHub say that:\n", "\n", "> \"*GitHub Actions are event-driven, meaning that you can run a series of commands after a specified event has occurred. For example, every time someone creates a pull request for a repository, you can automatically run a command that executes a software testing script.*\"\n", "\n", - "They are a powerful system for automating many software development processes, and open source projects get unlimited compute hours for free! A sequence of steps in GitHub Actions are be combined together into a \"workflow\", which can furthermore contain multiple \"jobs\", which are run on multiple machines, with (if needed) multiple operating systems, in parallel. For more information, read GitHub's [Introduction to GitHub Actions](https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/introduction-to-github-actions).\n", + "They are a powerful system for automating many software development processes, and open source projects get unlimited compute hours for free! A sequence of steps in GitHub Actions are be combined together into a \"workflow\", which can furthermore contain multiple \"jobs\", which are run on multiple machines, with (if needed) multiple operating systems, in parallel. For more information, read GitHub's [Introduction to GitHub Actions](https://docs.github.com/actions/learn-github-actions/introduction-to-github-actions).\n", "\n", "However, workflows can be difficult to create and debug, because:\n", "\n", @@ -95,7 +95,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "For information about all the fields in a *payload*, use the GitHub [webhook payload](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events/webhook-events-and-payloads#pull_request) documentation. For instance, the docs tell us that the \"action\" field can be:\n", + "For information about all the fields in a *payload*, use the GitHub [webhook payload](https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request) documentation. For instance, the docs tell us that the \"action\" field can be:\n", "\n", "> \"*opened, edited, closed, assigned, unassigned, review_requested, review_request_removed, ready_for_review, labeled, unlabeled, synchronize, locked, unlocked, or reopened*\"\n", "\n", @@ -265,7 +265,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The payload will be available in the [`github` context](https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#github-context), which is provided automatically to you using the `context_github` variable. When running locally, an example github context will be used instead. (This example github context will not, in general, have the same payload as the event you're using, so use the `example payload` for that.)\n", + "The payload will be available in the [`github` context](https://docs.github.com/actions/reference/context-and-expression-syntax-for-github-actions#github-context), which is provided automatically to you using the `context_github` variable. When running locally, an example github context will be used instead. (This example github context will not, in general, have the same payload as the event you're using, so use the `example payload` for that.)\n", "\n", "The `event` contains the actual payload:" ] @@ -437,7 +437,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Sometimes, you need to join more than one *job* in a workflow. This isn't common, but one example it's absolutely needed is if you want to build software or run tests on multiple platforms, and then have some step that runs before or after all of them. For instance, building and releasing software that needs to be built on each platform requires one job to create a release, and then a separate job to do the builds and add artifacts to the release, since GitHub Actions runs all your steps in a job in a single platform. Furthermore, we need to set up [dependencies between jobs](https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#creating-dependent-jobs) using `needs`. `ghapi` provides helpers to set up multi-job workflows with depedencies for you, which we'll show an example of here.\n", + "Sometimes, you need to join more than one *job* in a workflow. This isn't common, but one example it's absolutely needed is if you want to build software or run tests on multiple platforms, and then have some step that runs before or after all of them. For instance, building and releasing software that needs to be built on each platform requires one job to create a release, and then a separate job to do the builds and add artifacts to the release, since GitHub Actions runs all your steps in a job in a single platform. Furthermore, we need to set up [dependencies between jobs](https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#creating-dependent-jobs) using `needs`. `ghapi` provides helpers to set up multi-job workflows with depedencies for you, which we'll show an example of here.\n", "\n", "In this tutorial we're going to show how we created [hugo-mathjax](https://github.com/fastai/hugo-mathjax). The workflow in this project patches [Hugo](https://gohugo.io/) to add [Mathjax](https://www.mathjax.org/) support, then builds Mac, Ubuntu, and Windows versions of the software, creating a release which includes each of those builds as artifacts. It does the following:\n", "\n", @@ -469,7 +469,7 @@ "source": [ "This has some pieces we haven't seen before, so let's take a look at them now.\n", "\n", - "The `prebuild` bool tells `ghapi` to include a prebuild job (see `create_workflow` for the full workflow created). After you run the above, take a look at the YAML that was created, to see how it all works. We're going to need to modify the YAML, to add the [schedule](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#schedule) we want to run it on, using a `cron:` line. You can see the final YAML file [here](https://github.com/fastai/hugo-mathjax/blob/master/.github/workflows/python.yml).\n", + "The `prebuild` bool tells `ghapi` to include a prebuild job (see `create_workflow` for the full workflow created). After you run the above, take a look at the YAML that was created, to see how it all works. We're going to need to modify the YAML, to add the [schedule](https://docs.github.com/actions/reference/events-that-trigger-workflows#schedule) we want to run it on, using a `cron:` line. You can see the final YAML file [here](https://github.com/fastai/hugo-mathjax/blob/master/.github/workflows/python.yml).\n", "\n", "The prebuild job calls a prebuild script using a Ubuntu runner. We'll create the prebuild script now.\n", "\n", diff --git a/README.md b/README.md index a3906b6..0f991cc 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,15 @@ > A delightful and complete interface to GitHub's amazing API -`ghapi` provides 100% always-updated coverage of the entire [GitHub API](https://docs.github.com/en/free-pro-team@latest/rest). Because we automatically convert the [OpenAPI spec](https://docs.github.com/en/free-pro-team@latest/rest/overview/openapi-description) to a Pythonic API, `ghapi` is always up to date with the latest changes to GitHub APIs. Furthermore, because this is all done dynamically, the entire package is only 35kB in size! +`ghapi` provides 100% always-updated coverage of the entire [GitHub API](https://docs.github.com/rest). Because we automatically convert the [OpenAPI spec](https://docs.github.com/rest/overview/openapi-description) to a Pythonic API, `ghapi` is always up to date with the latest changes to GitHub APIs. Furthermore, because this is all done dynamically, the entire package is only 35kB in size! Using `ghapi`, you can automate nearly anything that you can do through the GitHub web interface or through the `git` client, such as: -- Open, list, comment on, or modify [issues](https://guides.github.com/features/issues/) or [pull requests](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/about-pull-requests) -- Create, list, or modify [git tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging) or [GitHub releases](https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/managing-releases-in-a-repository), including uploading release assets -- Configure and run GitHub [Actions](https://github.com/features/actions) and [webhooks](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events/about-webhooks) -- Set up GitHub [users](https://docs.github.com/en/free-pro-team@latest/rest/reference/users) and [organizations](https://docs.github.com/en/free-pro-team@latest/github/setting-up-and-managing-organizations-and-teams/about-organizations) -- Manage your [deployments](https://docs.github.com/en/free-pro-team@latest/rest/guides/delivering-deployments) +- Open, list, comment on, or modify [issues](https://guides.github.com/features/issues/) or [pull requests](https://docs.github.com/github/collaborating-with-issues-and-pull-requests/about-pull-requests) +- Create, list, or modify [git tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging) or [GitHub releases](https://docs.github.com/github/administering-a-repository/managing-releases-in-a-repository), including uploading release assets +- Configure and run GitHub [Actions](https://github.com/features/actions) and [webhooks](https://docs.github.com/developers/webhooks-and-events/about-webhooks) +- Set up GitHub [users](https://docs.github.com/rest/reference/users) and [organizations](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/about-organizations) +- Manage your [deployments](https://docs.github.com/rest/guides/delivering-deployments) - ...and much, much more. There are two ways to use `ghapi`: either through Python, or from the command line. An overview of each is provided below. @@ -54,36 +54,36 @@ api -- [actions](https://docs.github.com/en/free-pro-team@latest/rest/reference/actions) -- [activity](https://docs.github.com/en/free-pro-team@latest/rest/reference/activity) -- [apps](https://docs.github.com/en/free-pro-team@latest/rest/reference/apps) -- [billing](https://docs.github.com/en/free-pro-team@latest/rest/reference/billing) -- [checks](https://docs.github.com/en/free-pro-team@latest/rest/reference/checks) -- [code_scanning](https://docs.github.com/en/free-pro-team@latest/rest/reference/code-scanning) -- [codes_of_conduct](https://docs.github.com/en/free-pro-team@latest/rest/reference/codes-of-conduct) -- [emojis](https://docs.github.com/en/free-pro-team@latest/rest/reference/emojis) -- [enterprise_admin](https://docs.github.com/en/free-pro-team@latest/rest/reference/enterprise-admin) -- [gists](https://docs.github.com/en/free-pro-team@latest/rest/reference/gists) -- [git](https://docs.github.com/en/free-pro-team@latest/rest/reference/git) -- [gitignore](https://docs.github.com/en/free-pro-team@latest/rest/reference/gitignore) -- [interactions](https://docs.github.com/en/free-pro-team@latest/rest/reference/interactions) -- [issues](https://docs.github.com/en/free-pro-team@latest/rest/reference/issues) -- [licenses](https://docs.github.com/en/free-pro-team@latest/rest/reference/licenses) -- [markdown](https://docs.github.com/en/free-pro-team@latest/rest/reference/markdown) -- [meta](https://docs.github.com/en/free-pro-team@latest/rest/reference/meta) -- [migrations](https://docs.github.com/en/free-pro-team@latest/rest/reference/migrations) -- [oauth_authorizations](https://docs.github.com/en/free-pro-team@latest/rest/reference/oauth-authorizations) -- [orgs](https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs) -- [projects](https://docs.github.com/en/free-pro-team@latest/rest/reference/projects) -- [pulls](https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls) -- [rate_limit](https://docs.github.com/en/free-pro-team@latest/rest/reference/rate-limit) -- [reactions](https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions) -- [repos](https://docs.github.com/en/free-pro-team@latest/rest/reference/repos) -- [scim](https://docs.github.com/en/free-pro-team@latest/rest/reference/scim) -- [search](https://docs.github.com/en/free-pro-team@latest/rest/reference/search) -- [secret_scanning](https://docs.github.com/en/free-pro-team@latest/rest/reference/secret-scanning) -- [teams](https://docs.github.com/en/free-pro-team@latest/rest/reference/teams) -- [users](https://docs.github.com/en/free-pro-team@latest/rest/reference/users) +- [actions](https://docs.github.com/rest/reference/actions) +- [activity](https://docs.github.com/rest/reference/activity) +- [apps](https://docs.github.com/rest/reference/apps) +- [billing](https://docs.github.com/rest/reference/billing) +- [checks](https://docs.github.com/rest/reference/checks) +- [code_scanning](https://docs.github.com/rest/reference/code-scanning) +- [codes_of_conduct](https://docs.github.com/rest/reference/codes-of-conduct) +- [emojis](https://docs.github.com/rest/reference/emojis) +- [enterprise_admin](https://docs.github.com/rest/reference/enterprise-admin) +- [gists](https://docs.github.com/rest/reference/gists) +- [git](https://docs.github.com/rest/reference/git) +- [gitignore](https://docs.github.com/rest/reference/gitignore) +- [interactions](https://docs.github.com/rest/reference/interactions) +- [issues](https://docs.github.com/rest/reference/issues) +- [licenses](https://docs.github.com/rest/reference/licenses) +- [markdown](https://docs.github.com/rest/reference/markdown) +- [meta](https://docs.github.com/rest/reference/meta) +- [migrations](https://docs.github.com/rest/reference/migrations) +- [oauth_authorizations](https://docs.github.com/rest/reference/oauth-authorizations) +- [orgs](https://docs.github.com/rest/reference/orgs) +- [projects](https://docs.github.com/rest/reference/projects) +- [pulls](https://docs.github.com/rest/reference/pulls) +- [rate_limit](https://docs.github.com/rest/reference/rate-limit) +- [reactions](https://docs.github.com/rest/reference/reactions) +- [repos](https://docs.github.com/rest/reference/repos) +- [scim](https://docs.github.com/rest/reference/scim) +- [search](https://docs.github.com/rest/reference/search) +- [secret_scanning](https://docs.github.com/rest/reference/secret-scanning) +- [teams](https://docs.github.com/rest/reference/teams) +- [users](https://docs.github.com/rest/reference/users) @@ -144,7 +144,7 @@ api.git.get_ref(owner='fastai', repo='fastcore', ref='heads/master') -To use `ghapi` to access authenticated operations (other than when running through GitHub Actions), you will need a GitHub [personal access token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token), which is a secret code used to access your account. If you don't have one, [click here](https://github.com/settings/tokens/new) to create one. You'll be asked to enter a name -- choose anything you like, for instance "*ghapi*". You'll also be asked to choose "scopes"; this limits what you'll be able to do with the API using this token. If you're not sure, click "*repo*" "*gist*", "*notifications*", and "*workflow*". Then click "Generate Token" at the bottom of the screen, and copy the token (the long string of letters and numbers shown). You can easily do that by clicking the little clipboard icon next to the token. +To use `ghapi` to access authenticated operations (other than when running through GitHub Actions), you will need a GitHub [personal access token](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token), which is a secret code used to access your account. If you don't have one, [click here](https://github.com/settings/tokens/new) to create one. You'll be asked to enter a name -- choose anything you like, for instance "*ghapi*". You'll also be asked to choose "scopes"; this limits what you'll be able to do with the API using this token. If you're not sure, click "*repo*" "*gist*", "*notifications*", and "*workflow*". Then click "Generate Token" at the bottom of the screen, and copy the token (the long string of letters and numbers shown). You can easily do that by clicking the little clipboard icon next to the token. Rather than pasting that token into every script, it's easiest to save it as an environment variable. If you save it as `$GITHUB_TOKEN` then it will be most convenient, so add this to the end of your `.bashrc` or `.zshrc` file: @@ -191,7 +191,7 @@ api.issues.update(issue.number, state='closed') ## How to use - command line -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). We provide an overview here of one of the command line programs, `ghapi` -- see the full CLI docs page for details on all the programs available. +You can use `GhApi` via the command line, and can access nearly everything in the [GitHub API](https://docs.github.com/rest). We provide an overview here of one of the command line programs, `ghapi` -- see the full CLI docs page for details on all the programs available. We strongly recommend enabling tab completion for `ghapi`, which you can do by placing the following command at the end of your `~/.bashrc` or `~/.zshrc` file: diff --git a/docs/actions.html b/docs/actions.html index 37cb8bc..7526df2 100644 --- a/docs/actions.html +++ b/docs/actions.html @@ -48,10 +48,10 @@
env: CONTEXT_GITHUB: ${{ toJson(github) }}-
This stores the full github context, which includes information such as the name of the current workflow being run, the GitHub access token, and so forth.
+This stores the full github context, which includes information such as the name of the current workflow being run, the GitHub access token, and so forth.
As well as the github context, you can do that same thing for any of the other GitHub Actions contexts, which are:
github env job steps runner secrets strategy matrix needs
For instance, for the needs context, information about previous jobs specified in your needs clause, add this underneath your CONTEXT_GITHUB line:
For instance, for the needs context, information about previous jobs specified in your needs clause, add this underneath your CONTEXT_GITHUB line:
CONTEXT_NEEDS: ${{ toJson(needs) }}
Note that here's no harm having entries that are not used -- GitHub Actions will set them to an empty dictionary by default.
@@ -75,7 +75,7 @@GitHub also adds a number of GITHUB_* 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 to all runners. These are available through the env_github AttrDict, with the GITHUB_ prefix removed, and remainder converted to lowercase. For instance:
actions_outputDetails in the GitHub Documentation for set-output.
Details in the GitHub Documentation for set-output.
actions_debugDetails in the GitHub Documentation for debug. 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. 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.
actions_warnDetails in the GitHub Documentation for warning. 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. For the optional details, you can provide comma-delimited file, line, and column information, e.g.: file=app.js,line=1,col=5.
actions_errorDetails in the GitHub Documentation for error. 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. For the optional details, you can provide comma-delimited file, line, and column information, e.g.: file=app.js,line=1,col=5.
actions_groupDetails in the GitHub Documentation for grouping log lines.
+Details in the GitHub Documentation for grouping log lines.
actions_maskDetails in the GitHub Documentation for add-mask.
Details in the GitHub Documentation for add-mask.
You can use GhApi via the command line, and can access nearly everything in the GitHub API.
You can use GhApi via the command line, and can access nearly everything in the GitHub API.
There are three commands provided. For most people, ghapi will be the easiest to use. All three commands take the following parameters:
--help: list all parameters to this command and endpointghapi
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 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.
The first operation listed there is issues.list, 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.
The first operation listed there is issues.list, 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.
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.
ghpath
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. 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}".
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. 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}".
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.
GitHub has various rate limits 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 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.
hooks_url = 'https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events/webhook-events-and-payloads'
+hooks_url = 'https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads'
soup = BeautifulSoup(urlread(hooks_url))
events = L(soup.select('li.ml-0')).attrgot('text')[1:]
# As at 2020/01/12 the 'sponsor' event has two examples
diff --git a/docs/index.html b/docs/index.html
index cf76469..d91bc61 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -31,14 +31,14 @@
-ghapi provides 100% always-updated coverage of the entire GitHub API. Because we automatically convert the OpenAPI spec to a Pythonic API, ghapi is always up to date with the latest changes to GitHub APIs. Furthermore, because this is all done dynamically, the entire package is only 35kB in size!
+ghapi provides 100% always-updated coverage of the entire GitHub API. Because we automatically convert the OpenAPI spec to a Pythonic API, ghapi is always up to date with the latest changes to GitHub APIs. Furthermore, because this is all done dynamically, the entire package is only 35kB in size!
Using ghapi, you can automate nearly anything that you can do through the GitHub web interface or through the git client, such as:
-- Open, list, comment on, or modify issues or pull requests
-- Create, list, or modify git tags or GitHub releases, including uploading release assets
-- Configure and run GitHub Actions and webhooks
-- Set up GitHub users and organizations
-- Manage your deployments
+- Open, list, comment on, or modify issues or pull requests
+- Create, list, or modify git tags or GitHub releases, including uploading release assets
+- Configure and run GitHub Actions and webhooks
+- Set up GitHub users and organizations
+- Manage your deployments
- ...and much, much more.
There are two ways to use ghapi: either through Python, or from the command line. An overview of each is provided below.
@@ -167,36 +167,36 @@ How to use - Python
-- actions
-- activity
-- apps
-- billing
-- checks
-- code_scanning
-- codes_of_conduct
-- emojis
-- enterprise_admin
-- gists
-- git
-- gitignore
-- interactions
-- issues
-- licenses
-- markdown
-- meta
-- migrations
-- oauth_authorizations
-- orgs
-- projects
-- pulls
-- rate_limit
-- reactions
-- repos
-- scim
-- search
-- secret_scanning
-- teams
-- users
+- actions
+- activity
+- apps
+- billing
+- checks
+- code_scanning
+- codes_of_conduct
+- emojis
+- enterprise_admin
+- gists
+- git
+- gitignore
+- interactions
+- issues
+- licenses
+- markdown
+- meta
+- migrations
+- oauth_authorizations
+- orgs
+- projects
+- pulls
+- rate_limit
+- reactions
+- repos
+- scim
+- search
+- secret_scanning
+- teams
+- users
@@ -355,7 +355,7 @@ How to use - Python
-To use ghapi to access authenticated operations (other than when running through GitHub Actions), you will need a GitHub personal access token, which is a secret code used to access your account. If you don't have one, click here to create one. You'll be asked to enter a name -- choose anything you like, for instance "ghapi". You'll also be asked to choose "scopes"; this limits what you'll be able to do with the API using this token. If you're not sure, click "repo" "gist", "notifications", and "workflow". Then click "Generate Token" at the bottom of the screen, and copy the token (the long string of letters and numbers shown). You can easily do that by clicking the little clipboard icon next to the token.
+To use ghapi to access authenticated operations (other than when running through GitHub Actions), you will need a GitHub personal access token, which is a secret code used to access your account. If you don't have one, click here to create one. You'll be asked to enter a name -- choose anything you like, for instance "ghapi". You'll also be asked to choose "scopes"; this limits what you'll be able to do with the API using this token. If you're not sure, click "repo" "gist", "notifications", and "workflow". Then click "Generate Token" at the bottom of the screen, and copy the token (the long string of letters and numbers shown). You can easily do that by clicking the little clipboard icon next to the token.
Rather than pasting that token into every script, it's easiest to save it as an environment variable. If you save it as $GITHUB_TOKEN then it will be most convenient, so add this to the end of your .bashrc or .zshrc file:
export GITHUB_TOKEN=xxx
@@ -454,7 +454,7 @@ How to use - command line
-You can use GhApi via the command line, and can access nearly everything in the GitHub API. We provide an overview here of one of the command line programs, ghapi -- see the full CLI docs page for details on all the programs available.
+You can use GhApi via the command line, and can access nearly everything in the GitHub API. We provide an overview here of one of the command line programs, ghapi -- see the full CLI docs page for details on all the programs available.
We strongly recommend enabling tab completion for ghapi, which you can do by placing the following command at the end of your ~/.bashrc or ~/.zshrc file:
eval "$(completion-ghapi --install)"
diff --git a/docs/page.html b/docs/page.html
index 3f43eee..8bd2f21 100644
--- a/docs/page.html
+++ b/docs/page.html
@@ -44,7 +44,7 @@ Paged operations
-Some GitHub API operations return their results one page at a time. For instance, there are many thousands of 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, but if we call list_public we only see the first 30:
diff --git a/docs/tutorial_actions.html b/docs/tutorial_actions.html
index 5757c86..4d1a5d1 100644
--- a/docs/tutorial_actions.html
+++ b/docs/tutorial_actions.html
@@ -37,10 +37,10 @@ About GitHub Actions
-GitHub Actions help you automate tasks within your software development life cycle. GitHub say that:
+GitHub Actions help you automate tasks within your software development life cycle. GitHub say that:
"GitHub Actions are event-driven, meaning that you can run a series of commands after a specified event has occurred. For example, every time someone creates a pull request for a repository, you can automatically run a command that executes a software testing script."
-They are a powerful system for automating many software development processes, and open source projects get unlimited compute hours for free! A sequence of steps in GitHub Actions are be combined together into a "workflow", which can furthermore contain multiple "jobs", which are run on multiple machines, with (if needed) multiple operating systems, in parallel. For more information, read GitHub's Introduction to GitHub Actions.
+
They are a powerful system for automating many software development processes, and open source projects get unlimited compute hours for free! A sequence of steps in GitHub Actions are be combined together into a "workflow", which can furthermore contain multiple "jobs", which are run on multiple machines, with (if needed) multiple operating systems, in parallel. For more information, read GitHub's Introduction to GitHub Actions.
However, workflows can be difficult to create and debug, because:
- They run in a special environment which is difficult to replicate locally
@@ -127,7 +127,7 @@ Your first Python-based workflow
-For information about all the fields in a payload, use the GitHub webhook payload documentation. For instance, the docs tell us that the "action" field can be:
+For information about all the fields in a payload, use the GitHub webhook payload documentation. For instance, the docs tell us that the "action" field can be:
"opened, edited, closed, assigned, unassigned, review_requested, review_request_removed, ready_for_review, labeled, unlabeled, synchronize, locked, unlocked, or reopened"
Let's see what it contains for our example payload:
@@ -369,7 +369,7 @@ Your first Python-based workflow
-The payload will be available in the github context, which is provided automatically to you using the context_github variable. When running locally, an example github context will be used instead. (This example github context will not, in general, have the same payload as the event you're using, so use the example payload for that.)
+The payload will be available in the github context, which is provided automatically to you using the context_github variable. When running locally, an example github context will be used instead. (This example github context will not, in general, have the same payload as the event you're using, so use the example payload for that.)
The event contains the actual payload:
@@ -603,7 +603,7 @@ Advanced multi-job workflow
-Sometimes, you need to join more than one job in a workflow. This isn't common, but one example it's absolutely needed is if you want to build software or run tests on multiple platforms, and then have some step that runs before or after all of them. For instance, building and releasing software that needs to be built on each platform requires one job to create a release, and then a separate job to do the builds and add artifacts to the release, since GitHub Actions runs all your steps in a job in a single platform. Furthermore, we need to set up dependencies between jobs using needs. ghapi provides helpers to set up multi-job workflows with depedencies for you, which we'll show an example of here.
+Sometimes, you need to join more than one job in a workflow. This isn't common, but one example it's absolutely needed is if you want to build software or run tests on multiple platforms, and then have some step that runs before or after all of them. For instance, building and releasing software that needs to be built on each platform requires one job to create a release, and then a separate job to do the builds and add artifacts to the release, since GitHub Actions runs all your steps in a job in a single platform. Furthermore, we need to set up dependencies between jobs using needs. ghapi provides helpers to set up multi-job workflows with depedencies for you, which we'll show an example of here.
In this tutorial we're going to show how we created hugo-mathjax. The workflow in this project patches Hugo to add Mathjax support, then builds Mac, Ubuntu, and Windows versions of the software, creating a release which includes each of those builds as artifacts. It does the following:
- On a Ubuntu runner:
@@ -645,7 +645,7 @@ Advanced multi-job workflow
This has some pieces we haven't seen before, so let's take a look at them now.
-The prebuild bool tells ghapi to include a prebuild job (see create_workflow for the full workflow created). After you run the above, take a look at the YAML that was created, to see how it all works. We're going to need to modify the YAML, to add the schedule we want to run it on, using a cron: line. You can see the final YAML file here.
+The prebuild bool tells ghapi to include a prebuild job (see create_workflow for the full workflow created). After you run the above, take a look at the YAML that was created, to see how it all works. We're going to need to modify the YAML, to add the schedule we want to run it on, using a cron: line. You can see the final YAML file here.
The prebuild job calls a prebuild script using a Ubuntu runner. We'll create the prebuild script now.
The script needs to get the current Hugo release tag:
diff --git a/examples/_create_examples.ipynb b/examples/_create_examples.ipynb
index 05feb43..c0d5ebd 100644
--- a/examples/_create_examples.ipynb
+++ b/examples/_create_examples.ipynb
@@ -18,7 +18,7 @@
"metadata": {},
"outputs": [],
"source": [
- "hooks_url = 'https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events/webhook-events-and-payloads'\n",
+ "hooks_url = 'https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads'\n",
"soup = BeautifulSoup(urlread(hooks_url))\n",
"events = L(soup.select('li.ml-0')).attrgot('text')[1:]\n",
"# As at 2020/01/12 the 'sponsor' event has two examples\n",
diff --git a/ghapi/core.py b/ghapi/core.py
index 253cba5..a828fa1 100644
--- a/ghapi/core.py
+++ b/ghapi/core.py
@@ -81,7 +81,7 @@ def __str__(self): return "\n".join(str(v) for v in self.verbs)
def _repr_markdown_(self): return "\n".join(f'- {v._repr_markdown_()}' for v in self.verbs)
# Cell
-_docroot = 'https://docs.github.com/en/free-pro-team@latest/rest/reference/'
+_docroot = 'https://docs.github.com/rest/reference/'
# Cell
class GhApi(_GhObj):
diff --git a/index.ipynb b/index.ipynb
index 329d966..7498c99 100644
--- a/index.ipynb
+++ b/index.ipynb
@@ -24,15 +24,15 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "`ghapi` provides 100% always-updated coverage of the entire [GitHub API](https://docs.github.com/en/free-pro-team@latest/rest). Because we automatically convert the [OpenAPI spec](https://docs.github.com/en/free-pro-team@latest/rest/overview/openapi-description) to a Pythonic API, `ghapi` is always up to date with the latest changes to GitHub APIs. Furthermore, because this is all done dynamically, the entire package is only 35kB in size!\n",
+ "`ghapi` provides 100% always-updated coverage of the entire [GitHub API](https://docs.github.com/rest). Because we automatically convert the [OpenAPI spec](https://docs.github.com/rest/overview/openapi-description) to a Pythonic API, `ghapi` is always up to date with the latest changes to GitHub APIs. Furthermore, because this is all done dynamically, the entire package is only 35kB in size!\n",
"\n",
"Using `ghapi`, you can automate nearly anything that you can do through the GitHub web interface or through the `git` client, such as:\n",
"\n",
- "- Open, list, comment on, or modify [issues](https://guides.github.com/features/issues/) or [pull requests](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/about-pull-requests)\n",
- "- Create, list, or modify [git tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging) or [GitHub releases](https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/managing-releases-in-a-repository), including uploading release assets\n",
- "- Configure and run GitHub [Actions](https://github.com/features/actions) and [webhooks](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events/about-webhooks)\n",
- "- Set up GitHub [users](https://docs.github.com/en/free-pro-team@latest/rest/reference/users) and [organizations](https://docs.github.com/en/free-pro-team@latest/github/setting-up-and-managing-organizations-and-teams/about-organizations)\n",
- "- Manage your [deployments](https://docs.github.com/en/free-pro-team@latest/rest/guides/delivering-deployments)\n",
+ "- Open, list, comment on, or modify [issues](https://guides.github.com/features/issues/) or [pull requests](https://docs.github.com/github/collaborating-with-issues-and-pull-requests/about-pull-requests)\n",
+ "- Create, list, or modify [git tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging) or [GitHub releases](https://docs.github.com/github/administering-a-repository/managing-releases-in-a-repository), including uploading release assets\n",
+ "- Configure and run GitHub [Actions](https://github.com/features/actions) and [webhooks](https://docs.github.com/developers/webhooks-and-events/about-webhooks)\n",
+ "- Set up GitHub [users](https://docs.github.com/rest/reference/users) and [organizations](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/about-organizations)\n",
+ "- Manage your [deployments](https://docs.github.com/rest/guides/delivering-deployments)\n",
"- ...and much, much more.\n",
"\n",
"There are two ways to use `ghapi`: either through Python, or from the command line. An overview of each is provided below."
@@ -137,36 +137,36 @@
{
"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",
- "- [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",
- "- [orgs](https://docs.github.com/en/free-pro-team@latest/rest/reference/orgs)\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",
+ "- [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": [
""
@@ -299,7 +299,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "To use `ghapi` to access authenticated operations (other than when running through GitHub Actions), you will need a GitHub [personal access token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token), which is a secret code used to access your account. If you don't have one, [click here](https://github.com/settings/tokens/new) to create one. You'll be asked to enter a name -- choose anything you like, for instance \"*ghapi*\". You'll also be asked to choose \"scopes\"; this limits what you'll be able to do with the API using this token. If you're not sure, click \"*repo*\" \"*gist*\", \"*notifications*\", and \"*workflow*\". Then click \"Generate Token\" at the bottom of the screen, and copy the token (the long string of letters and numbers shown). You can easily do that by clicking the little clipboard icon next to the token.\n",
+ "To use `ghapi` to access authenticated operations (other than when running through GitHub Actions), you will need a GitHub [personal access token](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token), which is a secret code used to access your account. If you don't have one, [click here](https://github.com/settings/tokens/new) to create one. You'll be asked to enter a name -- choose anything you like, for instance \"*ghapi*\". You'll also be asked to choose \"scopes\"; this limits what you'll be able to do with the API using this token. If you're not sure, click \"*repo*\" \"*gist*\", \"*notifications*\", and \"*workflow*\". Then click \"Generate Token\" at the bottom of the screen, and copy the token (the long string of letters and numbers shown). You can easily do that by clicking the little clipboard icon next to the token.\n",
"\n",
"Rather than pasting that token into every script, it's easiest to save it as an environment variable. If you save it as `$GITHUB_TOKEN` then it will be most convenient, so add this to the end of your `.bashrc` or `.zshrc` file:\n",
"\n",
@@ -389,7 +389,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). We provide an overview here of one of the command line programs, `ghapi` -- see the full CLI docs page for details on all the programs available.\n",
+ "You can use `GhApi` via the command line, and can access nearly everything in the [GitHub API](https://docs.github.com/rest). We provide an overview here of one of the command line programs, `ghapi` -- see the full CLI docs page for details on all the programs available.\n",
"\n",
"We strongly recommend enabling tab completion for `ghapi`, which you can do by placing the following command at the end of your `~/.bashrc` or `~/.zshrc` file:\n",
"\n",