From 6de23c546f4091ac59f6d617fbc83b30f08c7937 Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 17 Mar 2023 13:31:02 +0100 Subject: [PATCH 1/6] chore: naming conventions for github actions Signed-off-by: blam --- .../software-templates/writing-custom-actions.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/features/software-templates/writing-custom-actions.md b/docs/features/software-templates/writing-custom-actions.md index 7a841dfd0e..93ea23cdbd 100644 --- a/docs/features/software-templates/writing-custom-actions.md +++ b/docs/features/software-templates/writing-custom-actions.md @@ -31,7 +31,7 @@ import { z } from 'zod'; export const createNewFileAction = () => { return createTemplateAction({ - id: 'mycompany:create-file', + id: 'file:create', schema: { input: z.object({ contents: z.string().describe('The contents of the file'), @@ -75,7 +75,7 @@ import { writeFile } from 'fs'; export const createNewFileAction = () => { return createTemplateAction<{ contents: string; filename: string }>({ - id: 'mycompany:create-file', + id: 'file:create', schema: { input: { required: ['contents', 'filename'], @@ -107,6 +107,17 @@ export const createNewFileAction = () => { }; ``` +#### A note on naming conventions + +Try to keep names consistent for both your own custom actions, and any actions contributed to open source. We've found that a seperation of `:` and using a verb as the last part of the name works well. +We follow `provider:entity:verb` or as close to this as possible for our built in actions. For example, `github:actions:create` or `github:repo:create`. + +Also feel free to use your company name to namespace them if you prefer too, for example `acme:file:create`. + +Prefer to use `camelCase` over `pascalCase` for these actions if possible, which leads to better reading and writing of template entity definitions. + +> We're aware that theres some exceptions to this, but try to follow as close as possible. We'll be working on migrating these in the repository over time too. + ### The context object When the action `handler` is called, we provide you a `context` as the only From 9adce708348f1d3f6534c02408301b7ef90847d3 Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 17 Mar 2023 14:11:11 +0100 Subject: [PATCH 2/6] chore: fixing spelling mistake Signed-off-by: blam --- docs/features/software-templates/writing-custom-actions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/features/software-templates/writing-custom-actions.md b/docs/features/software-templates/writing-custom-actions.md index 93ea23cdbd..480e0dbb14 100644 --- a/docs/features/software-templates/writing-custom-actions.md +++ b/docs/features/software-templates/writing-custom-actions.md @@ -109,14 +109,14 @@ export const createNewFileAction = () => { #### A note on naming conventions -Try to keep names consistent for both your own custom actions, and any actions contributed to open source. We've found that a seperation of `:` and using a verb as the last part of the name works well. +Try to keep names consistent for both your own custom actions, and any actions contributed to open source. We've found that a separation of `:` and using a verb as the last part of the name works well. We follow `provider:entity:verb` or as close to this as possible for our built in actions. For example, `github:actions:create` or `github:repo:create`. Also feel free to use your company name to namespace them if you prefer too, for example `acme:file:create`. Prefer to use `camelCase` over `pascalCase` for these actions if possible, which leads to better reading and writing of template entity definitions. -> We're aware that theres some exceptions to this, but try to follow as close as possible. We'll be working on migrating these in the repository over time too. +> We're aware that there are some exceptions to this, but try to follow as close as possible. We'll be working on migrating these in the repository over time too. ### The context object From 7600ced55e210aafc90a518ede40ff23d13d74c4 Mon Sep 17 00:00:00 2001 From: Ben Lambert Date: Mon, 20 Mar 2023 11:49:21 +0100 Subject: [PATCH 3/6] Update writing-custom-actions.md Signed-off-by: Ben Lambert --- docs/features/software-templates/writing-custom-actions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/software-templates/writing-custom-actions.md b/docs/features/software-templates/writing-custom-actions.md index 480e0dbb14..8311402f3c 100644 --- a/docs/features/software-templates/writing-custom-actions.md +++ b/docs/features/software-templates/writing-custom-actions.md @@ -114,7 +114,7 @@ We follow `provider:entity:verb` or as close to this as possible for our built i Also feel free to use your company name to namespace them if you prefer too, for example `acme:file:create`. -Prefer to use `camelCase` over `pascalCase` for these actions if possible, which leads to better reading and writing of template entity definitions. +Prefer to use `camelCase` over `snake-case` for these actions if possible, which leads to better reading and writing of template entity definitions. > We're aware that there are some exceptions to this, but try to follow as close as possible. We'll be working on migrating these in the repository over time too. From a0f66c48265808b596ad242e96abbdfc69bc715c Mon Sep 17 00:00:00 2001 From: Ben Lambert Date: Tue, 28 Mar 2023 12:57:28 +0200 Subject: [PATCH 4/6] Update docs/features/software-templates/writing-custom-actions.md Co-authored-by: Patrik Oldsberg Signed-off-by: Ben Lambert --- docs/features/software-templates/writing-custom-actions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/software-templates/writing-custom-actions.md b/docs/features/software-templates/writing-custom-actions.md index 8311402f3c..966cc3bdff 100644 --- a/docs/features/software-templates/writing-custom-actions.md +++ b/docs/features/software-templates/writing-custom-actions.md @@ -107,7 +107,7 @@ export const createNewFileAction = () => { }; ``` -#### A note on naming conventions +#### Naming Conventions Try to keep names consistent for both your own custom actions, and any actions contributed to open source. We've found that a separation of `:` and using a verb as the last part of the name works well. We follow `provider:entity:verb` or as close to this as possible for our built in actions. For example, `github:actions:create` or `github:repo:create`. From cf085b9d97e9b90210b76ae876216d5e29fce6a3 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 28 Mar 2023 12:59:49 +0200 Subject: [PATCH 5/6] chore: updating the example Signed-off-by: blam --- docs/features/software-templates/writing-custom-actions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/features/software-templates/writing-custom-actions.md b/docs/features/software-templates/writing-custom-actions.md index 966cc3bdff..18ef703330 100644 --- a/docs/features/software-templates/writing-custom-actions.md +++ b/docs/features/software-templates/writing-custom-actions.md @@ -75,7 +75,7 @@ import { writeFile } from 'fs'; export const createNewFileAction = () => { return createTemplateAction<{ contents: string; filename: string }>({ - id: 'file:create', + id: 'acme:file:create', schema: { input: { required: ['contents', 'filename'], @@ -112,7 +112,7 @@ export const createNewFileAction = () => { Try to keep names consistent for both your own custom actions, and any actions contributed to open source. We've found that a separation of `:` and using a verb as the last part of the name works well. We follow `provider:entity:verb` or as close to this as possible for our built in actions. For example, `github:actions:create` or `github:repo:create`. -Also feel free to use your company name to namespace them if you prefer too, for example `acme:file:create`. +Also feel free to use your company name to namespace them if you prefer too, for example `acme:file:create` like above. Prefer to use `camelCase` over `snake-case` for these actions if possible, which leads to better reading and writing of template entity definitions. From 7fc4dcea11fb2996fa9b1e8bde4a803325dcdf97 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 28 Mar 2023 13:04:56 +0200 Subject: [PATCH 6/6] chore: woops missed one Signed-off-by: blam --- docs/features/software-templates/writing-custom-actions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/software-templates/writing-custom-actions.md b/docs/features/software-templates/writing-custom-actions.md index 18ef703330..f04940a418 100644 --- a/docs/features/software-templates/writing-custom-actions.md +++ b/docs/features/software-templates/writing-custom-actions.md @@ -31,7 +31,7 @@ import { z } from 'zod'; export const createNewFileAction = () => { return createTemplateAction({ - id: 'file:create', + id: 'acme:file:create', schema: { input: z.object({ contents: z.string().describe('The contents of the file'),