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. 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" 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); + } }); } 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 }; }