gautamkrishnar/blog-post-workflow

[Feature]: Problems randomEmoji in Templates

eryajf opened this issue ยท 5 comments

Describe the bug
When I used randomEmoji in multiple feed templates, they got the same results.

Expected behavior
I hope that different feeds will get different results.

Screenshots

image

Workflow Yml Used

name: Latest blog post workflow
on:
  schedule: # Run workflow automatically
    - cron: '0 * * * *' # Runs every hour, on the hour
  workflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the Github Actions Workflow page directly
  push:
    branches:
      - main

jobs:
  update-readme-with-blog:
    name: Update this repo's README with latest blog posts
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Pull in dev.to posts
        uses: gautamkrishnar/blog-post-workflow@v1
        with:
          max_post_count: 3
          committer_username: "eryajf"
          committer_email: "eryajf@163.com"
          feed_list: "https://wiki.eryajf.net/rss.xml"
          template: "$newline- $randomEmoji(๐Ÿ’ฏ,๐Ÿ”ฅ,๐Ÿ’ซ,๐Ÿš€,๐ŸŒฎ,๐Ÿ“,๐Ÿฅณ,๐Ÿ’ป,๐Ÿงฐ,๐ŸŠ,๐Ÿฅฐ,๐Ÿง,๐Ÿค“,๐Ÿ˜Ž,๐Ÿฅธ,๐Ÿคฉ,๐Ÿค—,๐Ÿค”,๐Ÿซฃ,๐Ÿคญ,๐Ÿค ,๐Ÿ‘น,๐Ÿ‘บ,๐Ÿคก,๐Ÿค–,๐ŸŽƒ,๐Ÿ˜บ,๐Ÿซถ,๐Ÿ‘,๐Ÿ’ช,๐Ÿ’„,๐Ÿ‘€,๐Ÿง ,๐Ÿง‘โ€๐Ÿซ,๐Ÿ‘จโ€๐Ÿซ,๐Ÿ’‚,๐Ÿง‘โ€๐Ÿ’ป,๐Ÿฅท,๐Ÿ’ƒ,๐Ÿ•ด,๐Ÿ’ผ,๐ŸŽ“,๐Ÿป,๐Ÿต,๐Ÿ™‰,๐Ÿฆ„,๐Ÿฆ†,๐Ÿฆ…,๐Ÿฆ,๐Ÿฆฃ,๐Ÿ˜,๐Ÿฆ’,๐Ÿฆ,๐ŸŽ,๐Ÿฆฉ,๐Ÿฒ,๐ŸŒ,๐ŸŒœ,๐ŸŒ,๐ŸŒˆ,๐ŸŒŠ,๐ŸŽฌ,๐ŸŽญ,๐Ÿš€,๐Ÿšฆ,โ›ฝ๏ธ,๐Ÿ—ฝ,๐ŸŽก,๐ŸŒ‹,๐ŸŒ,๐Ÿ’ก,๐Ÿ•ฏ,๐Ÿชœ,๐Ÿงฐ,โš—๏ธ,๐Ÿ”ญ,๐Ÿช„,๐ŸŽŠ,๐ŸŽ‰,) [$title]($url) $newline"
      - name: Pull in dev.to posts
        uses: gautamkrishnar/blog-post-workflow@v1
        with:
          max_post_count: 3
          committer_username: "eryajf"
          committer_email: "eryajf@163.com"
          comment_tag_name: "DecoHack"
          feed_list: "https://www.decohack.com/feed"
          template: "$newline- $randomEmoji(๐Ÿ’ฏ,๐Ÿ”ฅ,๐Ÿ’ซ,๐Ÿš€,๐ŸŒฎ,๐Ÿ“,๐Ÿฅณ,๐Ÿ’ป,๐Ÿงฐ,๐ŸŠ,๐Ÿฅฐ,๐Ÿง,๐Ÿค“,๐Ÿ˜Ž,๐Ÿฅธ,๐Ÿคฉ,๐Ÿค—,๐Ÿค”,๐Ÿซฃ,๐Ÿคญ,๐Ÿค ,๐Ÿ‘น,๐Ÿ‘บ,๐Ÿคก,๐Ÿค–,๐ŸŽƒ,๐Ÿ˜บ,๐Ÿซถ,๐Ÿ‘,๐Ÿ’ช,๐Ÿ’„,๐Ÿ‘€,๐Ÿง ,๐Ÿง‘โ€๐Ÿซ,๐Ÿ‘จโ€๐Ÿซ,๐Ÿ’‚,๐Ÿง‘โ€๐Ÿ’ป,๐Ÿฅท,๐Ÿ’ƒ,๐Ÿ•ด,๐Ÿ’ผ,๐ŸŽ“,๐Ÿป,๐Ÿต,๐Ÿ™‰,๐Ÿฆ„,๐Ÿฆ†,๐Ÿฆ…,๐Ÿฆ,๐Ÿฆฃ,๐Ÿ˜,๐Ÿฆ’,๐Ÿฆ,๐ŸŽ,๐Ÿฆฉ,๐Ÿฒ,๐ŸŒ,๐ŸŒœ,๐ŸŒ,๐ŸŒˆ,๐ŸŒŠ,๐ŸŽฌ,๐ŸŽญ,๐Ÿš€,๐Ÿšฆ,โ›ฝ๏ธ,๐Ÿ—ฝ,๐ŸŽก,๐ŸŒ‹,๐ŸŒ,๐Ÿ’ก,๐Ÿ•ฏ,๐Ÿชœ,๐Ÿงฐ,โš—๏ธ,๐Ÿ”ญ,๐Ÿช„,๐ŸŽŠ,๐ŸŽ‰,) [$title]($url) $newline"

@eryajf just released a new version with this feature, please use the following yaml code:

on:
  schedule: # Run workflow automatically
    - cron: '0 * * * *' # Runs every hour, on the hour
  workflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the Github Actions Workflow page directly
  push:
    branches:
      - main

jobs:
  update-readme-with-blog:
    name: Update this repo's README with latest blog posts
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Pull in dev.to posts
        uses: gautamkrishnar/blog-post-workflow@v1
        with:
          max_post_count: 3
          committer_username: "eryajf"
          committer_email: "eryajf@163.com"
          feed_list: "https://wiki.eryajf.net/rss.xml"
          rand_seed: "seed1"
          template: "$newline- $randomEmoji(๐Ÿ’ฏ,๐Ÿ”ฅ,๐Ÿ’ซ,๐Ÿš€,๐ŸŒฎ,๐Ÿ“,๐Ÿฅณ,๐Ÿ’ป,๐Ÿงฐ,๐ŸŠ,๐Ÿฅฐ,๐Ÿง,๐Ÿค“,๐Ÿ˜Ž,๐Ÿฅธ,๐Ÿคฉ,๐Ÿค—,๐Ÿค”,๐Ÿซฃ,๐Ÿคญ,๐Ÿค ,๐Ÿ‘น,๐Ÿ‘บ,๐Ÿคก,๐Ÿค–,๐ŸŽƒ,๐Ÿ˜บ,๐Ÿซถ,๐Ÿ‘,๐Ÿ’ช,๐Ÿ’„,๐Ÿ‘€,๐Ÿง ,๐Ÿง‘โ€๐Ÿซ,๐Ÿ‘จโ€๐Ÿซ,๐Ÿ’‚,๐Ÿง‘โ€๐Ÿ’ป,๐Ÿฅท,๐Ÿ’ƒ,๐Ÿ•ด,๐Ÿ’ผ,๐ŸŽ“,๐Ÿป,๐Ÿต,๐Ÿ™‰,๐Ÿฆ„,๐Ÿฆ†,๐Ÿฆ…,๐Ÿฆ,๐Ÿฆฃ,๐Ÿ˜,๐Ÿฆ’,๐Ÿฆ,๐ŸŽ,๐Ÿฆฉ,๐Ÿฒ,๐ŸŒ,๐ŸŒœ,๐ŸŒ,๐ŸŒˆ,๐ŸŒŠ,๐ŸŽฌ,๐ŸŽญ,๐Ÿš€,๐Ÿšฆ,โ›ฝ๏ธ,๐Ÿ—ฝ,๐ŸŽก,๐ŸŒ‹,๐ŸŒ,๐Ÿ’ก,๐Ÿ•ฏ,๐Ÿชœ,๐Ÿงฐ,โš—๏ธ,๐Ÿ”ญ,๐Ÿช„,๐ŸŽŠ,๐ŸŽ‰) [$title]($url) $newline"
      - name: Pull in dev.to posts
        uses: gautamkrishnar/blog-post-workflow@v1
        with:
          max_post_count: 3
          committer_username: "eryajf"
          committer_email: "eryajf@163.com"
          comment_tag_name: "DecoHack"
          feed_list: "https://www.decohack.com/feed"
          rand_seed: "seed2"
          template: "$newline- $randomEmoji(๐Ÿ’ฏ,๐Ÿ”ฅ,๐Ÿ’ซ,๐Ÿš€,๐ŸŒฎ,๐Ÿ“,๐Ÿฅณ,๐Ÿ’ป,๐Ÿงฐ,๐ŸŠ,๐Ÿฅฐ,๐Ÿง,๐Ÿค“,๐Ÿ˜Ž,๐Ÿฅธ,๐Ÿคฉ,๐Ÿค—,๐Ÿค”,๐Ÿซฃ,๐Ÿคญ,๐Ÿค ,๐Ÿ‘น,๐Ÿ‘บ,๐Ÿคก,๐Ÿค–,๐ŸŽƒ,๐Ÿ˜บ,๐Ÿซถ,๐Ÿ‘,๐Ÿ’ช,๐Ÿ’„,๐Ÿ‘€,๐Ÿง ,๐Ÿง‘โ€๐Ÿซ,๐Ÿ‘จโ€๐Ÿซ,๐Ÿ’‚,๐Ÿง‘โ€๐Ÿ’ป,๐Ÿฅท,๐Ÿ’ƒ,๐Ÿ•ด,๐Ÿ’ผ,๐ŸŽ“,๐Ÿป,๐Ÿต,๐Ÿ™‰,๐Ÿฆ„,๐Ÿฆ†,๐Ÿฆ…,๐Ÿฆ,๐Ÿฆฃ,๐Ÿ˜,๐Ÿฆ’,๐Ÿฆ,๐ŸŽ,๐Ÿฆฉ,๐Ÿฒ,๐ŸŒ,๐ŸŒœ,๐ŸŒ,๐ŸŒˆ,๐ŸŒŠ,๐ŸŽฌ,๐ŸŽญ,๐Ÿš€,๐Ÿšฆ,โ›ฝ๏ธ,๐Ÿ—ฝ,๐ŸŽก,๐ŸŒ‹,๐ŸŒ,๐Ÿ’ก,๐Ÿ•ฏ,๐Ÿชœ,๐Ÿงฐ,โš—๏ธ,๐Ÿ”ญ,๐Ÿช„,๐ŸŽŠ,๐ŸŽ‰) [$title]($url) $newline"

Thank you, this is possible. I would like to know what the current default value "username/repository" refers to and whether it is possible to change this default value to a timestamp, so that this parameter does not need to be configured by default.

@eryajf setting it as a timestamp value is a bad idea. It will update your repository every 5 minutes. That's why it is better to keep it as a static value. Using different static values gives different results. By default, if you don't give rand_seed argument, it will default to username/repository -> in your case eryajf/eryajf. This will make workflow generate unique random emojis for every user which is using it.

see: https://github.com/eryajf/read-list

In fact, I want to use this project to make a repository for reading lists, so at this time I need to set different values for different blogs, so at this time, if the default value is the timestamp of the project runtime, I don't have to care about this configuration item anymore. Similarly, even in personal warehouses, the use of timestamps is a matter of no effect.

Of course, what I write manually now can meet my needs. I just hope this place can be more elegant.