diff --git a/README.md b/README.md index 05db23a..cbcc7c3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,17 @@ -https://github.com/actions-on-google/actions-builder-hello-world-nodejs -https://console.actions.google.com/u/0/project/github-project-321e8/settings/general -https://developers.google.com/assistant/actionssdk/gactions -https://github.com/octokit/core.js#readme -https://actions-on-google.github.io/assistant-conversation-nodejs/3.0.0/index.html \ No newline at end of file +* https://github.com/actions-on-google/actions-builder-hello-world-nodejs +* https://console.actions.google.com/u/0/project/github-project-321e8/settings/general +* https://developers.google.com/assistant/actionssdk/gactions +* https://github.com/octokit/core.js#readme +* https://actions-on-google.github.io/assistant-conversation-nodejs/3.0.0/index.html +* https://github.com/actions-on-google/assistant-conversation-nodejs/blob/master/src/api/schema.ts +* https://console.firebase.google.com/u/0/project/github-project-321e8/functions/logs?search=labels.execution_id%20%3D%20%22f9oir517vv00%22&severity=DEBUG& +* https://console.actions.google.com/u/0/project/github-project-321e8/simulator?disableAutoPreview +* https://medium.com/@alkeshsrivastava11/speed-up-actions-on-google-development-workflow-with-local-fulfilment-7de17d5f166f +* https://developers.google.com/assistant/conversational/actions + +* https://github.com/boyney123/awesome-github-templates + + + +* Spring Boot : https://github.com/Spring-Boot-Framework/Spring-Boot-Application-Template +* Typescript : https://github.com/carsonfarmer/ts-template \ No newline at end of file diff --git a/sdk/webhooks/ActionsOnGoogleFulfillment/test.js b/sdk/webhooks/ActionsOnGoogleFulfillment/test.js index a513ac8..c2089a1 100644 --- a/sdk/webhooks/ActionsOnGoogleFulfillment/test.js +++ b/sdk/webhooks/ActionsOnGoogleFulfillment/test.js @@ -3,14 +3,43 @@ const { Octokit } = require("@octokit/core"); const octokit = new Octokit({ auth: `test` }); +const sanitize = function(repoName){ + return repoName.split(' ').join('_'); +} -const start = async function(){ - const response = await octokit.request("GET /users/:username/repos", { - username: "jlengrand", +const createJavaRepoFromTemplate = createRepoFromTemplate(sanitizedRepoName, "Spring-Boot-Framework", "Spring-Boot-Application-Template"); +const createTypescriptRepoFromTemplate = createRepoFromTemplate(sanitizedRepoName, "carsonfarmer", "ts-template"); + +const createRepoFromTemplate = async function(sanitizedRepoName, templateOwner, templateRepo){ + const response = await octokit.request("POST /repos/:template_owner/:template_repo/generate", { + template_owner: templateOwner, + template_repo: templateRepo, + name: sanitizedRepoName, + mediaType: { + previews: ["baptiste-preview"], + }, }); console.log(`${response.data.length} repos found.`); console.log(`${response.data[0]}`); } -start(); \ No newline at end of file +const listRepos = async function(){ + const response = await octokit.request("GET /users/:username/repos", { + username: "jlengrand", + mediaType: { + previews: ["baptiste"], + }, + }); + + console.log(`${response.data.length} repos found.`); + console.log(`${response.data[0]}`); +} + +const createFromTemplate = async function(repoName){ + const response = await createJavaRepoFromTemplate(sanitize(repoName)); + console.log(`${response}`); +} + +// start(); +createFromTemplate("a test repo");