From 35e0af66f85b21ec96f1222ce358b73bec2f48a9 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 7 Jul 2022 13:23:59 +0200 Subject: [PATCH 1/4] Added botComments input --- action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/action.yml b/action.yml index 1ddf2fb..43033ec 100644 --- a/action.yml +++ b/action.yml @@ -29,6 +29,9 @@ inputs: height: description: "Height of the screen" default: "630" + botComments: + description: "Whether a comment with a preview image should be posted" + default: "yes" runs: using: "docker" image: "Dockerfile" From d9422dc7cd826107a08b6d572f89acdd6507b81b Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 7 Jul 2022 13:27:34 +0200 Subject: [PATCH 2/4] Update repo-props.ts --- src/repo-props.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/repo-props.ts b/src/repo-props.ts index 25a5f12..f2bfe19 100644 --- a/src/repo-props.ts +++ b/src/repo-props.ts @@ -12,6 +12,7 @@ async function getRepoProps() { const fontSize = getInput("fontSize"); const width = getInput("width"); const height = getInput("height"); + const botComments = getInput("botComments"); return { assetPath, componentUrl, @@ -20,7 +21,8 @@ async function getRepoProps() { fontColor, fontSize, width, - height + height, + botComments }; } From 83d38f8d1246e43532ef76a9ce1a124f519954da Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 7 Jul 2022 13:29:02 +0200 Subject: [PATCH 3/4] Update main.ts --- src/main.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index f5b2960..053cb80 100644 --- a/src/main.ts +++ b/src/main.ts @@ -45,10 +45,12 @@ async function run() { commitFile(image, repoProps, property.filename); - const markdown = commentMarkdown( - `${repoProps.assetPath}${property.filename}` - ); - await createComment(markdown); + if (repoProps.botComments != "no") { + const markdown = commentMarkdown( + `${repoProps.assetPath}${property.filename}` + ); + await createComment(markdown); + } }); } From 7cc814a0212592f1eaf065dfd47765976cc9b562 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 7 Jul 2022 13:32:53 +0200 Subject: [PATCH 4/4] Update README.md --- README.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3391d98..cd78aa8 100644 --- a/README.md +++ b/README.md @@ -62,14 +62,15 @@ Works only with Pull Requests and `md` and `mdx` files. These are props that you can configure in the action file to customise the working. -| Props | Description | Required | -| ------------ | :--------------------------------------: | :------: | -| path | Path to place the image URL in | true | -| commitMsg | Commit message when image is added | | -| background | Background color, gradient or image url | | -| fontColor | any css supported color | | -| fontSize | the font size | | -| componentUrl | Web Component to be rendered for output. | | +| Props | Description | Required | +| ------------ | :-----------------------------------------------------: | :------: | +| path | Path to place the image URL in | true | +| commitMsg | Commit message when image is added | | +| background | Background color, gradient or image url | | +| fontColor | any css supported color | | +| fontSize | the font size | | +| componentUrl | Web Component to be rendered for output. | | +| botComments | Whether a comment with a preview image should be posted | Frontmatter level props on a document always takes precedence over Repository level props. @@ -106,6 +107,10 @@ Frontmatter level props on a document always takes precedence over Repository le 5. **I need to format the title** The `title` prop supports markdown, feel _free_ to _use_ it. + +6. **I don't want these preview image bot comments** + + the `botComments` repo prop should be set to `"no"` ### I need more customisation on the output.