Skip to content

Commit 1bf6e02

Browse files
authored
Merge branch 'master' into lfdebrux-add-media-types-support
2 parents 263fc04 + bf5f4b5 commit 1bf6e02

32 files changed

+1096
-609
lines changed

00_core.ipynb

Lines changed: 235 additions & 97 deletions
Large diffs are not rendered by default.

01_actions.ipynb

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@
2525
"outputs": [],
2626
"source": [
2727
"#export\n",
28-
"from fastcore.utils import *\n",
29-
"from fastcore.script import *\n",
30-
"from fastcore.foundation import *\n",
31-
"from fastcore.meta import *\n",
28+
"from fastcore.all import *\n",
3229
"from ghapi.core import *\n",
3330
"from ghapi.templates import *\n",
3431
"\n",
@@ -65,13 +62,13 @@
6562
" CONTEXT_GITHUB: ${{ toJson(github) }}\n",
6663
"```\n",
6764
"\n",
68-
"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",
65+
"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",
6966
"\n",
7067
"As well as the `github` context, you can do that same thing for any of the other GitHub Actions contexts, which are:\n",
7168
"\n",
7269
"`github` `env` `job` `steps` `runner` `secrets` `strategy` `matrix` `needs`\n",
7370
"\n",
74-
"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",
71+
"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",
7572
"\n",
7673
"```bash\n",
7774
" CONTEXT_NEEDS: ${{ toJson(needs) }}\n",
@@ -110,7 +107,7 @@
110107
"cell_type": "markdown",
111108
"metadata": {},
112109
"source": [
113-
"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:"
110+
"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:"
114111
]
115112
},
116113
{
@@ -376,9 +373,9 @@
376373
"#export\n",
377374
"@call_parse\n",
378375
"def gh_create_workflow(\n",
379-
" name:Param(\"Name of the workflow file\", str),\n",
380-
" event:Param(\"Event to listen for\", str),\n",
381-
" contexts:Param(\"Space-delimited extra contexts to include in `env` in addition to 'github'\", str)=''\n",
376+
" name:str, # Name of the workflow file\n",
377+
" event:str, # Event to listen for\n",
378+
" contexts:str='' # Space-delimited extra contexts to include in `env` in addition to github\n",
382379
"):\n",
383380
" \"Supports `gh-create-workflow`, a CLI wrapper for `create_workflow`.\"\n",
384381
" create_workflow(name, Event[event], contexts.split())"
@@ -531,7 +528,7 @@
531528
"cell_type": "markdown",
532529
"metadata": {},
533530
"source": [
534-
"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)."
531+
"Details in the [GitHub Documentation for `set-output`](https://docs.github.com/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter)."
535532
]
536533
},
537534
{
@@ -550,7 +547,7 @@
550547
"cell_type": "markdown",
551548
"metadata": {},
552549
"source": [
553-
"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."
550+
"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."
554551
]
555552
},
556553
{
@@ -569,7 +566,7 @@
569566
"cell_type": "markdown",
570567
"metadata": {},
571568
"source": [
572-
"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`."
569+
"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`."
573570
]
574571
},
575572
{
@@ -588,7 +585,7 @@
588585
"cell_type": "markdown",
589586
"metadata": {},
590587
"source": [
591-
"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`."
588+
"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`."
592589
]
593590
},
594591
{
@@ -629,7 +626,7 @@
629626
"cell_type": "markdown",
630627
"metadata": {},
631628
"source": [
632-
"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)."
629+
"Details in the GitHub Documentation for [grouping log lines](https://docs.github.com/actions/reference/workflow-commands-for-github-actions#grouping-log-lines)."
633630
]
634631
},
635632
{
@@ -648,7 +645,7 @@
648645
"cell_type": "markdown",
649646
"metadata": {},
650647
"source": [
651-
"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)."
648+
"Details in the [GitHub Documentation for `add-mask`](https://docs.github.com/actions/reference/workflow-commands-for-github-actions#masking-a-value-in-log)."
652649
]
653650
},
654651
{
@@ -723,7 +720,7 @@
723720
],
724721
"metadata": {
725722
"kernelspec": {
726-
"display_name": "Python 3",
723+
"display_name": "Python 3 (ipykernel)",
727724
"language": "python",
728725
"name": "python3"
729726
}

02_auth.ipynb

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
"outputs": [],
2525
"source": [
2626
"#export\n",
27-
"from fastcore.utils import *\n",
28-
"from fastcore.foundation import *\n",
27+
"from fastcore.all import *\n",
2928
"from ghapi.core import *\n",
3029
"\n",
3130
"import webbrowser,time\n",
@@ -110,7 +109,7 @@
110109
"outputs": [],
111110
"source": [
112111
"#export\n",
113-
"_def_clientid = '771f3c3af93face45f52'"
112+
"_def_clientid = '71604a89b882ab8c8634'"
114113
]
115114
},
116115
{
@@ -146,7 +145,7 @@
146145
{
147146
"data": {
148147
"text/plain": [
149-
"('466da70dae0a30102cd6df6436b57a6a5c58701a', 'CA0C-C4AE')"
148+
"('62956bc850018fb2e5c4b62501df72bbe5583a5a', '247D-B1A6')"
150149
]
151150
},
152151
"execution_count": null,
@@ -189,7 +188,7 @@
189188
"name": "stdout",
190189
"output_type": "stream",
191190
"text": [
192-
"First copy your one-time code: CA0C-C4AE\n",
191+
"First copy your one-time code: 247D-B1A6\n",
193192
"Then visit https://github.com/login/device in your browser, and paste the code when prompted.\n"
194193
]
195194
}
@@ -340,7 +339,7 @@
340339
"name": "stdout",
341340
"output_type": "stream",
342341
"text": [
343-
"First copy your one-time code: \u001b[33mDD47-0B67\u001b[m\n",
342+
"First copy your one-time code: \u001b[33m4ACE-3C18\u001b[m\n",
344343
"Then visit https://github.com/login/device in your browser, and paste the code when prompted.\n",
345344
"Waiting for authorization...Authentication not complete!\n"
346345
]
@@ -375,8 +374,7 @@
375374
"Converted 50_fullapi.ipynb.\n",
376375
"Converted 80_tutorial_actions.ipynb.\n",
377376
"Converted 90_build_lib.ipynb.\n",
378-
"Converted Untitled.ipynb.\n",
379-
"Converted ghapi demo.ipynb.\n",
377+
"Converted ghapi_demo.ipynb.\n",
380378
"Converted index.ipynb.\n"
381379
]
382380
}
@@ -397,7 +395,7 @@
397395
],
398396
"metadata": {
399397
"kernelspec": {
400-
"display_name": "Python 3",
398+
"display_name": "Python 3 (ipykernel)",
401399
"language": "python",
402400
"name": "python3"
403401
}

03_page.ipynb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
"outputs": [],
2626
"source": [
2727
"#export\n",
28-
"from fastcore.utils import *\n",
29-
"from fastcore.foundation import *\n",
28+
"from fastcore.all import *\n",
3029
"from ghapi.core import *\n",
3130
"\n",
3231
"import re\n",
@@ -44,7 +43,7 @@
4443
"cell_type": "markdown",
4544
"metadata": {},
4645
"source": [
47-
"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:"
46+
"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:"
4847
]
4948
},
5049
{

04_event.ipynb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
"outputs": [],
2626
"source": [
2727
"#export\n",
28-
"from fastcore.utils import *\n",
29-
"from fastcore.foundation import *\n",
30-
"from fastcore.meta import *\n",
28+
"from fastcore.all import *\n",
3129
"from ghapi.core import *\n",
3230
"from ghapi.page import *\n",
3331
"from ghapi.actions import *\n",
@@ -552,7 +550,7 @@
552550
],
553551
"metadata": {
554552
"kernelspec": {
555-
"display_name": "Python 3",
553+
"display_name": "Python 3 (ipykernel)",
556554
"language": "python",
557555
"name": "python3"
558556
}

10_cli.ipynb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"outputs": [],
1717
"source": [
1818
"#export\n",
19-
"from fastcore.utils import *\n",
20-
"from fastcore.foundation import *\n",
19+
"from fastcore.all import *\n",
2120
"import ghapi.core as gh,inspect\n",
2221
"from ghapi.core import *\n",
2322
"from collections import defaultdict"
@@ -35,7 +34,7 @@
3534
"cell_type": "markdown",
3635
"metadata": {},
3736
"source": [
38-
"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",
37+
"You can use `GhApi` via the command line, and can access nearly everything in the [GitHub API](https://docs.github.com/rest).\n",
3938
"\n",
4039
"There are three commands provided. For most people, `ghapi` will be the easiest to use. All three commands take the following parameters:\n",
4140
"\n",
@@ -62,7 +61,7 @@
6261
"source": [
6362
"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",
6463
"\n",
65-
"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",
64+
"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",
6665
"\n",
6766
"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."
6867
]
@@ -227,7 +226,7 @@
227226
"cell_type": "markdown",
228227
"metadata": {},
229228
"source": [
230-
"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",
229+
"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",
231230
"\n",
232231
"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."
233232
]

0 commit comments

Comments
 (0)