Skip to content

Commit

Permalink
feat: update variable description
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentLvr committed Sep 29, 2023
1 parent 52cbff4 commit 8d4975a
Showing 1 changed file with 77 additions and 10 deletions.
87 changes: 77 additions & 10 deletions GitHub/GitHub_Connect_from_Naas_Chat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,16 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"id": "cc038b10-2679-42bc-909e-09a298339df4",
"metadata": {
"execution": {
"iopub.execute_input": "2023-09-29T15:25:31.216782Z",
"iopub.status.busy": "2023-09-29T15:25:31.216547Z",
"iopub.status.idle": "2023-09-29T15:25:31.221856Z",
"shell.execute_reply": "2023-09-29T15:25:31.221306Z",
"shell.execute_reply.started": "2023-09-29T15:25:31.216756Z"
},
"papermill": {},
"tags": []
},
Expand All @@ -125,23 +132,30 @@
},
"source": [
"### Setup variables\n",
"- `secret_value`: Value of the secret to add\n",
"- `github_token`: GitHub token to be add as secret.\n",
"- `body`: This variable stores the body to be send by the webhook."
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"id": "8d86b8fb-2576-426d-a305-50043c24c23e",
"metadata": {
"execution": {
"iopub.execute_input": "2023-09-29T15:25:31.723052Z",
"iopub.status.busy": "2023-09-29T15:25:31.722817Z",
"iopub.status.idle": "2023-09-29T15:25:31.725963Z",
"shell.execute_reply": "2023-09-29T15:25:31.725319Z",
"shell.execute_reply.started": "2023-09-29T15:25:31.723028Z"
},
"papermill": {},
"tags": [
"parameters"
]
},
"outputs": [],
"source": [
"secret_value = None\n",
"github_token = None\n",
"body = {}"
]
},
Expand Down Expand Up @@ -170,9 +184,16 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"id": "42d27d66-3076-4fc6-a5dc-c1533bd47bd0",
"metadata": {
"execution": {
"iopub.execute_input": "2023-09-29T15:25:32.450489Z",
"iopub.status.busy": "2023-09-29T15:25:32.450181Z",
"iopub.status.idle": "2023-09-29T15:25:32.453929Z",
"shell.execute_reply": "2023-09-29T15:25:32.453319Z",
"shell.execute_reply.started": "2023-09-29T15:25:32.450455Z"
},
"papermill": {},
"tags": [
"parameters"
Expand All @@ -182,7 +203,7 @@
"source": [
"# Parameters\n",
"if len(body) > 0:\n",
" secret_value = body.get(\"secret_value\") "
" github_token = body.get(\"github_token\") "
]
},
{
Expand All @@ -209,9 +230,16 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"id": "fc6771cb-a9d8-431e-acd9-ebf19f26f362",
"metadata": {
"execution": {
"iopub.execute_input": "2023-09-29T15:24:34.112656Z",
"iopub.status.busy": "2023-09-29T15:24:34.112403Z",
"iopub.status.idle": "2023-09-29T15:24:34.206188Z",
"shell.execute_reply": "2023-09-29T15:24:34.205346Z",
"shell.execute_reply.started": "2023-09-29T15:24:34.112624Z"
},
"papermill": {},
"tags": []
},
Expand All @@ -235,7 +263,7 @@
" message = e\n",
" return status, message\n",
" \n",
"status, message = add_or_update_secret(\"GITHUB_TOKEN\", secret_value)"
"status, message = add_or_update_secret(\"GITHUB_TOKEN\", github_token)"
]
},
{
Expand Down Expand Up @@ -270,13 +298,52 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"id": "7432dbf6-f47b-4f6c-8b56-4ad5b215e657",
"metadata": {
"execution": {
"iopub.execute_input": "2023-09-29T15:24:34.207614Z",
"iopub.status.busy": "2023-09-29T15:24:34.207254Z",
"iopub.status.idle": "2023-09-29T15:24:34.311078Z",
"shell.execute_reply": "2023-09-29T15:24:34.310524Z",
"shell.execute_reply.started": "2023-09-29T15:24:34.207584Z"
},
"papermill": {},
"tags": []
},
"outputs": [],
"outputs": [
{
"data": {
"text/markdown": [
"Response Set as JSON, preview below: "
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/json": {
"message": "🔐❌ No secret added.",
"status": "ok"
},
"text/plain": [
"<IPython.core.display.JSON object>"
]
},
"metadata": {
"application/json": {
"expanded": false,
"naas_api": true,
"root": "root"
}
},
"output_type": "display_data"
}
],
"source": [
"naas.webhook.respond_json(\n",
" {\n",
Expand Down

0 comments on commit 8d4975a

Please sign in to comment.