Skip to content

Commit 9f13c43

Browse files
reformat doc, code cleanup
1 parent 1ee5cb8 commit 9f13c43

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ This workflow has additional options that you can use to customize it for your u
5757
| `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 |
5858
| `comment_tag_name` | `BLOG-POST-LIST` | Allows you to override the default comment tag name (`<!-- BLOG-POST-LIST:START --><!-- BLOG-POST-LIST:END -->`), if you want to show multiple instances of the action on the same repo, see advanced usage for more info | No |
5959
| `disable_sort` | `false` | Disables the sorting of the list based on publish date | No |
60-
| `sort_order` | `desc` | Specifies the sort order of posts when date sorting is enabled (`disable_sort` is `false`). Supports `asc` (ascending, oldest first) and `desc` (descending, newest first). Has no effect if `disable_sort` is `true`. Works even without `pubDate` in RSS feeds (items without dates are placed at the end). | No |
60+
| `sort_order` | `desc` | Specifies the sort order of posts when date sorting is enabled (`disable_sort` is `false`). Supports `asc` (ascending, oldest first) and `desc` (descending, newest first). Has no effect if `disable_sort` is `true`. Works even without `pubDate` in RSS feeds (items without dates are placed at the end). | No |
6161
| `feed_names` | `""` | Comma-separated list of RSS feed names, this is intended to be used with `template` option. eg: `Blog,Dev.to` | No |
6262
| `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.<br/><br/>**Supported variables** <ul><li>`$title`: Title of the post</li><li>`$url`: URL of the post</li><li>`$description`: Description of the post</li><li>`$newline`: Inserts a newline</li><li>`$date`: Inserts the post date based on the `date_format` specified</li><li>`$randomEmoji`: Allow you to use random emojis in the post, pass emojis as the parameter to chose one of it randomly in each post item. Eg: `$randomEmoji(💯,🔥,💫,🚀,🌮)`. See the [issue comment](https://github.com/gautamkrishnar/blog-post-workflow/issues/29#issuecomment-699622596) for more details</li><li>`$emojiKey`: You can use this argument to show emojis on each of your post item sequentially in the order you specify. Example: `$emojiKey(💯,🔥,💫)`. See the [issue comment](https://github.com/gautamkrishnar/blog-post-workflow/issues/29#issuecomment-699622596) for more details</li><li>`$counter`: You can use this argument to show a serial number on each of your post items.</li><li>`$feedName`: You can use this argument to show a string that represents your website name, use feed_names argument to specify it for each feed item. Eg: `feed_list: "https://dev.to/feed/gautamkrishnar,https://www.gautamkrishnar.com/feed/"`, `feed_names: "Dev.to,Personal Website"`</li><li>`$categories`: You can use this to show a comma separated list of post categories if available. See [this issue](https://git.io/JXeUG) for more details</li></ul> | No |
6363
| `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: <ul><li>`$category`: Represents individual category item</li></ul> eg: `<code>$category</code> ` will show category list as `category1` `category2` `category3` etc | No |

src/blog-post-workflow.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ const TOTAL_POST_COUNT = Number.parseInt(core.getInput('max_post_count'));
3535
const ENABLE_SORT = core.getInput('disable_sort') === 'false';
3636

3737
// Specifies sort order
38-
const SORT_ORDER = core.getInput('sort_order'); // 'asc' or 'desc'
39-
40-
// Reverses sort order when enabled
41-
const REVERSE_SORT = core.getInput('reverse_sort') === 'true';
38+
const SORT_ORDER = core.getInput('sort_order'); // 'asc' or 'desc
4239

4340
// Disables validation checks
4441
const ENABLE_VALIDATION = core.getInput('disable_item_validation') === 'false';

test/sort-order-asc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe('Ascending sort order readme (sort_order: asc)', function () {
66
const envObj = {
77
...process.env,
88
...DEFAULT_TEST_ENV,
9-
INPUT_SORT_ORDER: 'asc' // Changed from REVERSE_SORT: 'true'
9+
INPUT_SORT_ORDER: 'asc'
1010
};
1111
// Snapshot name will also need to be changed to Readme.sort-order-asc.md
1212
await runAndCompareSnap('Readme.sort-order-asc.md', envObj);

0 commit comments

Comments
 (0)