diff --git a/GitHub/GitHub_Connect_from_Naas_Chat.ipynb b/GitHub/GitHub_Connect_from_Naas_Chat.ipynb index b744dcd66e..6cd00391b1 100644 --- a/GitHub/GitHub_Connect_from_Naas_Chat.ipynb +++ b/GitHub/GitHub_Connect_from_Naas_Chat.ipynb @@ -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": [] }, @@ -125,15 +132,22 @@ }, "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" @@ -141,7 +155,7 @@ }, "outputs": [], "source": [ - "secret_value = None\n", + "github_token = None\n", "body = {}" ] }, @@ -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" @@ -182,7 +203,7 @@ "source": [ "# Parameters\n", "if len(body) > 0:\n", - " secret_value = body.get(\"secret_value\") " + " github_token = body.get(\"github_token\") " ] }, { @@ -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": [] }, @@ -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)" ] }, { @@ -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": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/json": { + "message": "🔐❌ No secret added.", + "status": "ok" + }, + "text/plain": [ + "" + ] + }, + "metadata": { + "application/json": { + "expanded": false, + "naas_api": true, + "root": "root" + } + }, + "output_type": "display_data" + } + ], "source": [ "naas.webhook.respond_json(\n", " {\n",