github-activity-readme icon indicating copy to clipboard operation
github-activity-readme copied to clipboard

Support for multiple GH_USERNAME

Open tushar5526 opened this issue 2 years ago • 4 comments

Add support to show recent activities of multiple accounts on your readme. GH_USERNAME can be a list of accounts to track.

tushar5526 avatar Sep 22 '23 12:09 tushar5526

My concern is about feature creep. This Action is simple their to give other people some idea about what you are currently working on and not meant for tracking other or multiple accounts? What's your opinion about this @jamesgeorge007? Same goes for #109

tuunit avatar Sep 22 '23 14:09 tuunit

Oh, I currently maintain a bot named pep8speaks that comments on PRs with linting changes. As the bot is used by a lot of projects, we were planning to showcase the bot's recent activity on the README of the project.

The feature to track multiple accounts comes from the idea of having a common Readme on the org's page to showcase all the bots that we have.

tushar5526 avatar Sep 22 '23 17:09 tushar5526

I agree with @tuunit. This is a very niche use case and will lead to unnecessary complexity, given that the underlying library doesn't support it out of the box. Let's keep this open and see if there are similar interests.

jamesgeorge007 avatar Sep 23 '23 12:09 jamesgeorge007

@tushar5526

A solution I can propose to you is the following:

  1. You can run the action multiple times (once for each bot)
  2. Write the output to different files using the TARGET_FILE input Parameter
  3. Run a simple step in the end to concatenate everything inside the orgs readme

Pseudo code:

- name: Bot1 Activity
  uses: [email protected]
  with:
    GH_USERNAME: bot1
    TARGET_FILE: bot1.md
.
.
.
- name: Concatenate README.md
  run: |
       # first cat overwrites the current content and all following statements append
       cat bot1.md > README.md
       cat bot2.md >> README.md
       cat bot3.md >> README.md

- name: push
  uses: github-actions-x/[email protected]
  with:
    github-token: ${{ secrets.GITHUB_TOKEN }}
    push-branch: 'master'
    commit-message: 'update bots activity'
    rebase: 'true'

tuunit avatar Sep 23 '23 12:09 tuunit