diff --git a/README.md b/README.md index f84d7e3..db1a24b 100644 --- a/README.md +++ b/README.md @@ -46,39 +46,40 @@ This workflow has additional options that you can use to customize it for your use case. The following are the list of options available: -| Option | Default Value | Description | Required | -|---------------------------|-----------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| -| `feed_list` | `""` | Comma-separated list of RSS feed urls, eg: `https://example1.com,https://example2.com` | Yes | -| `max_post_count` | `5` | Maximum number of posts you want to show on your readme, all feeds combined | No | -| `readme_path` | `./README.md` | Comma separated paths of the readme files you want to update | No | -| `gh_token` | your GitHub token with repo scope | Use this to configure the token of the user that commits the workflow result to GitHub | No | -| `comment_tag_name` | `BLOG-POST-LIST` | Allows you to override the default comment tag name (``), if you want to show multiple instances of the action on the same repo, see advanced usage for more info | No | -| `disable_sort` | `false` | Disables the sorting of the list based on publish date | No | -| `feed_names` | `""` | Comma-separated list of RSS feed names, this is intended to be used with `template` option. eg: `Blog,Dev.to` | No | -| `template` | `default` | Allows you to change the structure of the posts list by using different variables. By default this workflow uses markdown list format to render the posts, you can override this behavior using this option. Eg: `[$title]($url) ` will give you a space-separated list of posts.

**Supported variables** | No | -| `categories_template` | `default` | By default `$categories` variable in the template is a comma separated string of categories. This option will allow you override it and customize the category item according to your use case. Following are the variables available: eg: `$category ` will show category list as `category1` `category2` `category3` etc | No | -| `date_format` | `UTC:ddd mmm dd yyyy h:MM TT` | Allows you to change the format of the date or time displayed when using the $date in the template option. This uses NPM dateformat library, please read the library [documentation](https://www.npmjs.com/package/dateformat#named-formats) for the supported formats | No | -| `user_agent` | `rss-parser` | Allows you to customize the user agent used by the RSS feed crawler | No | -| `accept_header` | `application/rss+xml` | Allows you to customize the accept header of the http requests | No | -| `tag_post_pre_newline` | `true` if you are not using **template** option | Allows you to insert a newline before the closing tag and after the opening tag when using the template option if needed, for better formatting | No | -| `filter_comments` | `stackoverflow/Comment by $author/,stackexchange/Comment by $author/` | Comma separated list of platforms you want to enable the comment filter.

**Available filters** | No | -| `custom_tags` | `""` | Allows you to use the custom tags from your feed items in your template. Format: `variableName/tagName/,variableName/tagName/`. Please see the [issue comment](https://github.com/gautamkrishnar/blog-post-workflow/issues/28#issuecomment-696024087) for more details | No | -| `title_max_length` | `""` | Allows you to trim the title in the posts list, excess text will be appended with an ellipsis `...` | No | -| `description_max_length` | `""` | Allows you to trim the description in the posts list, excess text will be appended with an ellipsis `...` | No | -| `item_exec` | `""` | Allows you to execute custom JavaScript code on each post item fetched from the xml to do advanced text manipulation. Please see the [issue comment](https://github.com/gautamkrishnar/blog-post-workflow/issues/34#issuecomment-706582788) as an example | No | -| `commit_message` | `Updated with the latest blog posts` | Allows you to customize the commit message | No | -| `committer_username` | `blog-post-bot` | Allows you to customize the committer username | No | -| `committer_email` | `blog-post-bot@example.com` | Allows you to customize the committer email | No | -| `output_only` | `false` | Sets the generated array as `results` [output variable](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs) so that it can be consumed in other actions and parsed via utilities like [jq](https://stedolan.github.io/jq/). This will also prevent committing to readme. See [#51](https://github.com/gautamkrishnar/blog-post-workflow/issues/51#issuecomment-758570235) for more details about the output format and how to use it. This will also generate a JSON file named `/tmp/blog_post_workflow_output.json` that you can use to consume the generated data and avoid issues like [#110](https://github.com/gautamkrishnar/blog-post-workflow/issues/110). | No | -| `enable_keepalive` | `true` | Workflow will automatically do a dummy commit to keep the repository active if there is no commit activity for the last 50 days. GitHub will stop running all cron based triggers if the repository is not active for more than 60 days. This flag allows you to disable this feature. See [#53](https://git.io/Jtm4V) for more details. | No | -| `retry_count` | `0` | Maximum number of times to retry the fetch operation if it fails, See [#66](https://github.com/gautamkrishnar/blog-post-workflow/issues/66) for more details. | No | -| `retry_wait_time` | `1` | Time to wait before each retry operation in seconds. | No | -| `disable_html_encoding` | `false` | Disables html encoding of the feed contents. | No | -| `disable_item_validation` | `false` | Disables the validation checks for Title, publish date and URL. | No | -| `filter_dates` | `""` | Allows you to filter post items based on date range.

**Supported Values** Make sure that you set the `max_post_count` to a higher value to get rid of max post count filtering, before using the above options. | No | -| `rand_seed` | `"username/repository"` | Provide your own seeding string for the randomness. More info: [#152](https://github.com/gautamkrishnar/blog-post-workflow/issues/152) | No | -| `remove_duplicates` | `false` | Allows you to remove duplicate blog posts from multiple sources, if are cross posting. This filters contents based on blog post's title. | No | -| `skip_commit` | `false` | Allows you to prevent the workflow from creating a new commit in the repository. Nevertheless of this option, changes to the readme will be made. This is particularly useful if you want to do the commits manually using the git cli or another workflow. One of the important thing to note is that the workflow will still do the keepalive commits, if you want to disable it you can use the `enable_keepalive` option instead. | No | +| Option | Default Value | Description | Required | +|---------------------------|------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| +| `feed_list` | `""` | Comma-separated list of RSS feed urls, eg: `https://example1.com,https://example2.com` | Yes | +| `max_post_count` | `5` | Maximum number of posts you want to show on your readme, all feeds combined | No | +| `readme_path` | `./README.md` | Comma separated paths of the readme files you want to update | No | +| `gh_token` | your GitHub token with repo scope | Use this to configure the token of the user that commits the workflow result to GitHub | No | +| `comment_tag_name` | `BLOG-POST-LIST` | Allows you to override the default comment tag name (``), if you want to show multiple instances of the action on the same repo, see advanced usage for more info | No | +| `disable_sort` | `false` | Disables the sorting of the list based on publish date | No | +| `feed_names` | `""` | Comma-separated list of RSS feed names, this is intended to be used with `template` option. eg: `Blog,Dev.to` | No | +| `template` | `default` | Allows you to change the structure of the posts list by using different variables. By default this workflow uses markdown list format to render the posts, you can override this behavior using this option. Eg: `[$title]($url) ` will give you a space-separated list of posts.

**Supported variables** | No | +| `categories_template` | `default` | By default `$categories` variable in the template is a comma separated string of categories. This option will allow you override it and customize the category item according to your use case. Following are the variables available: eg: `$category ` will show category list as `category1` `category2` `category3` etc | No | +| `date_format` | `UTC:ddd mmm dd yyyy h:MM TT` | Allows you to change the format of the date or time displayed when using the $date in the template option. This uses NPM dateformat library, please read the library [documentation](https://www.npmjs.com/package/dateformat#named-formats) for the supported formats | No | +| `user_agent` | `rss-parser` | Allows you to customize the user agent used by the RSS feed crawler | No | +| `accept_header` | `application/rss+xml` | Allows you to customize the accept header of the http requests | No | +| `tag_post_pre_newline` | `true` if you are not using **template** option | Allows you to insert a newline before the closing tag and after the opening tag when using the template option if needed, for better formatting | No | +| `filter_comments` | `stackoverflow/Comment by $author/,stackexchange/Comment by $author/` | Comma separated list of platforms you want to enable the comment filter.

**Available filters** | No | +| `custom_tags` | `""` | Allows you to use the custom tags from your feed items in your template. Format: `variableName/tagName/,variableName/tagName/`. Please see the [issue comment](https://github.com/gautamkrishnar/blog-post-workflow/issues/28#issuecomment-696024087) for more details | No | +| `title_max_length` | `""` | Allows you to trim the title in the posts list, excess text will be appended with an ellipsis `...` | No | +| `description_max_length` | `""` | Allows you to trim the description in the posts list, excess text will be appended with an ellipsis `...` | No | +| `item_exec` | `""` | Allows you to execute custom JavaScript code on each post item fetched from the xml to do advanced text manipulation. Please see the [issue comment](https://github.com/gautamkrishnar/blog-post-workflow/issues/34#issuecomment-706582788) as an example | No | +| `commit_message` | `Updated with the latest blog posts` | Allows you to customize the commit message | No | +| `committer_username` | `blog-post-bot` | Allows you to customize the committer username | No | +| `committer_email` | `blog-post-bot@example.com` | Allows you to customize the committer email | No | +| `output_only` | `false` | Sets the generated array as `results` [output variable](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs) so that it can be consumed in other actions and parsed via utilities like [jq](https://stedolan.github.io/jq/). This will also prevent committing to readme. See [#51](https://github.com/gautamkrishnar/blog-post-workflow/issues/51#issuecomment-758570235) for more details about the output format and how to use it. This will also generate a JSON file named `/tmp/blog_post_workflow_output.json` that you can use to consume the generated data and avoid issues like [#110](https://github.com/gautamkrishnar/blog-post-workflow/issues/110). | No | +| `enable_keepalive` | `true` | Workflow will automatically do a dummy commit to keep the repository active if there is no commit activity for the last 50 days. GitHub will stop running all cron based triggers if the repository is not active for more than 60 days. This flag allows you to disable this feature. See [#53](https://git.io/Jtm4V) for more details. | No | +| `retry_count` | `0` | Maximum number of times to retry the fetch operation if it fails, See [#66](https://github.com/gautamkrishnar/blog-post-workflow/issues/66) for more details. | No | +| `retry_wait_time` | `1` | Time to wait before each retry operation in seconds. | No | +| `disable_html_encoding` | `false` | Disables html encoding of the feed contents. | No | +| `disable_item_validation` | `false` | Disables the validation checks for Title, publish date and URL. | No | +| `filter_dates` | `""` | Allows you to filter post items based on date range.

**Supported Values** Make sure that you set the `max_post_count` to a higher value to get rid of max post count filtering, before using the above options. | No | +| `rand_seed` | `"username/repository"` | Provide your own seeding string for the randomness. More info: [#152](https://github.com/gautamkrishnar/blog-post-workflow/issues/152) | No | +| `remove_duplicates` | `false` | Allows you to remove duplicate blog posts from multiple sources, if are cross posting. This filters contents based on blog post's title. | No | +| `skip_commit` | `false` | Allows you to prevent the workflow from creating a new commit in the repository. Nevertheless of this option, changes to the readme will be made. This is particularly useful if you want to do the commits manually using the git cli or another workflow. One of the important thing to note is that the workflow will still do the keepalive commits, if you want to disable it you can use the `enable_keepalive` option instead. | No | +| `dummy_commit_message` | `dummy commit to keep the repository active, see https://git.io/Jtm4V` | Dummy commit message, This is when the workflow is doing automated commits to keep the repository active | No | ## Advanced usage examples diff --git a/action.yml b/action.yml index 06f4ae4..ec9fd11 100644 --- a/action.yml +++ b/action.yml @@ -125,6 +125,10 @@ inputs: description: "Skips committing the changes to repo" default: "false" required: false + dummy_commit_message: + description: "Dummy commit message, This is when the workflow is doing automated commits to keep the repository active" + default: "dummy commit to keep the repository active, see https://git.io/Jtm4V" + required: false outputs: results: description: "JSON stringified array of posts" diff --git a/src/blog-post-workflow.js b/src/blog-post-workflow.js index 8f8e059..5940756 100644 --- a/src/blog-post-workflow.js +++ b/src/blog-post-workflow.js @@ -369,8 +369,8 @@ const runWorkflow = async () => { const committerUsername = core.getInput('committer_username'); const committerEmail = core.getInput('committer_email'); const message = await keepaliveWorkflow.KeepAliveWorkflow(GITHUB_TOKEN, committerUsername, committerEmail, - 'dummy commit to keep the repository active, see https://git.io/Jtm4V', 50, true); - core.info(message); + core.getInput('dummy_commit_message'), 50, true); + core.info(message.toString()); } else { core.info('No change detected, skipping'); }