Giter Site home page Giter Site logo

jamesgeorge007 / github-activity-readme Goto Github PK

View Code? Open in Web Editor NEW
790.0 9.0 229.0 383 KB

Updates README with the recent GitHub activity of a user

License: MIT License

JavaScript 100.00%
readme readme-template javascript github-action github-actions github-workflow activity profile-page profile-readme github-action-javascript

github-activity-readme's Introduction

GitHub Activity in Readme

Updates README.md with the recent GitHub activity of a user.

profile-repo


Instructions

  • Add the comment <!--START_SECTION:activity--> (entry point) within README.md. You can find an example here.

  • It's the time to create a workflow file.

.github/workflows/update-readme.yml

name: Update README
on:
  schedule:
    - cron: "*/30 * * * *"
  workflow_dispatch:
jobs:
  build:
    name: Update this repo's README with recent activity
    runs-on: ubuntu-latest
    permissions:
      contents: write

    steps:
      - uses: actions/checkout@v3
      - uses: jamesgeorge007/github-activity-readme@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The above job runs every half an hour, you can change it as you wish based on the cron syntax.

Please note that only those public events that belong to the following list show up:-

  • IssueEvent
  • ReleaseEvent
  • IssueCommentEvent
  • PullRequestEvent

You can find an example here.

Override defaults

Use the following input params to customize it for your use case:-

Input Param Default Value Description
GH_USERNAME Your GitHub username Username for which to generate the activity overview
COMMIT_NAME github-actions[bot] Name of the committer
COMMIT_EMAIL 41898282+github-actions[bot]@users.noreply.github.com Email of the committer
COMMIT_MSG ⚡ Update README with the recent activity Commit message used while committing to the repo
EMPTY_COMMIT_MSG 📝 empty commit to keep workflow active after 60 days of no activity Commit message used when there are no updates
MAX_LINES 5 The maximum number of lines populated in your readme file
TARGET_FILE README.md The file to insert recent activity into
name: Update README
on:
  schedule:
    - cron: "*/30 * * * *"
  workflow_dispatch:
jobs:
  build:
    name: Update this repo's README with recent activity
    runs-on: ubuntu-latest
    permissions:
      contents: write

    steps:
      - uses: actions/checkout@v3
      - uses: jamesgeorge007/github-activity-readme@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          COMMIT_MSG: "Specify a custom commit message"
          MAX_LINES: 10
          COMMIT_NAME: GitHub Activity Readme

Inspired by JasonEtco/activity-box

github-activity-readme's People

Contributors

aeswibon avatar akashgp09 avatar ashawe avatar congnguyendinh0 avatar crazyuploader avatar danivijay avatar dependabot[bot] avatar gaushikmr avatar iamgojoof6eyes avatar jamesgeorge007 avatar kanna727 avatar lissy93 avatar lorenzo0111 avatar panosru avatar swimmy4days avatar techphil avatar tuunit avatar yuna0x0 avatar zeevo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

github-activity-readme's Issues

Let users set custom committer's email address?

Hello,

Thanks for working on this! ❤️
However, like other actions out there, it'd be cool to let the users set their own custom committer's email address. What do you think about this?

Bad Credential Issue

@jamesgeorge007 I have followed the instruction provided in GitHub-activity-readme, however, when I run the workflow, I get the following error:

Error: Bad credentials 
✖  fatal     HttpError: Bad credentials 

Which credentials do I have to setup?

Add an option to target different files

By default (as it should be) it uploads automatically the README.md file. I imagine some other scenarios where someone may want to update another file (let's say README_it.md beside the activity will be displayed in English).

Currently, this is not an option because there's no option to choose the target file. I'd like the option to use different markdown files to be uploaded using a key like: TARGET_FILE.

I'll try to make a PR if my free time allows me.

Thanks for all the work!

Want to use different path for README.md file

In my case when running the workflow please give an option to add a different path for readme file.
I need it because, I use teoxoy/profile-readme-stats in combination with your repo.
In that workflow action we need separate TEMPLATE.md file.

So I want to push recent activity to TEMPLATE.md file, and then push stats (using teoxoy/profile-readme-stats) from TEMPLATE.md to README.md

Did you get my point?

Fails if no activity found

It seems that if there is no activity present, the action fails with:

...
⬤  debug     Activity for ..Username.., 62 events found.
✖  fatal     No PullRequest/Issue/IssueComment events found

Expected:
Ideally it should interpret 0 as ok and maybe put a placeholder message like "Currently there is no activity logged," or something along those lines on the README page.

Actual:
No activity fails the action on each run until you do a pull request or something.

HTML support

If you add something for HTML support then it would be better

No PullRequest/Issue/IssueComment events found

githubactivityreadmeerror

I followed codeSTACKr's Tutorial on how to implement the Activity Readme Action. However, all the jobs so far have failed (see the attached image). I have never submitted a PullRequests before, and I also have never created an Issue or commented on one, and I assume that the error is related to that,

I'd be pleased if this can be fixed. If I can help with anything, just let me know, I'd love to help!

Error: Invalid status code: 1

I'm receiving error Error: Invalid status code: 1 . Below error message. Any idea why?

Run jamesgeorge007/github-activity-readme@master
⬤  debug     Getting activity for rafal-kos
⬤  debug     Activity for rafal-kos, 17 events found.
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
⬤  debug     Something went wrong
✖  fatal     Error: Invalid status code: 1 
    at ChildProcess.<anonymous> (/home/runner/work/_actions/jamesgeorge007/github-activity-readme/master/dist/index.js:12526:15)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Not all activities appear on the list

Hi,

I am not sure what exactly included in "recent GitHub activity of a user" but it seems like we have some issues here.

This is what is shown on my list of recent activities (as of 16/08/2020):
recent

It seems like a partial list only since I did a few commits on the same date, see here: https://github.com/ikostan/Exercism_Python_Track/commits/master

It looks even more strange if you try to compare it to "Recent Activities" that are shown by GitHub itself, see attached screenshot:
recent

Overall it seems like it ignores all activities that are not related to the "jamesgeorge007/github-activity-readme" repository...

My README repository is here: https://github.com/ikostan/ikostan

Comment:

I tried to run it with 2 different configurations:

  1. - uses: jamesgeorge007/[email protected]
  2. - uses: jamesgeorge007/github-activity-readme@master

Getting Actions Error

` Set up job
Run actions/checkout@v21s

Run jamesgeorge007/github-activity-readme@master0s
**> ✖ fatal No events found

Run jamesgeorge007/github-activity-readme@master
⬤ debug Getting activity for arshsahzad
⬤ debug Activity for arshsahzad, 100 events found.
✖ fatal No events found**

Post Run actions/checkout@v20s
Complete job`

Option to only list one entry per type.

I feel like it would be better, if you could set that only one entry of each type (comment, issue open, issue close, pr open, pr close, etc.) would be displayed in the history, or otherwise something like this would pop up:
image

Extra Slash in URLs

I don't know if it's a bug, or what but every link generated on the markdown file has an extra slash after "github.com".

Getting
https://github.com//crazyuploader/bombsquad-docker
where as it should be
https://github.com/crazyuploader/bombsquad-docker

Commiting dist file

Hello,

I was looking through the code and it seems that you are using deprecated package:: @zeit/ncc.
It could be replaced with @vercel/ncc or even removed at all, because there is just one .js file. Commiting dist folder to the repository seems to be not the greatest idea anyway.
I can code the changes if you want to.

Have a nice day :)

"Discussions" contributions not listed

I noticed that contributions in Discussions are not listed in my recent activity list.
This would be a nice addition to this Action.

Thank you so much for your work! It is really great to have this in my README.

Kind regards
Julian

Run cancelled (360 minute timeout)

Hey there, I recently received multiple motifications on my email of runs failed related to this action. The problem seems to be that the action takes over 6 hours to complete and it's getting cancelled because of the 360 minute max timeout.

I suppose this may be caused by some sort of caught exception that may not end the process gracefully so it remains idle indefinitely.

The logs aren't very useful, this is the only thing I have: image

But once again, this just started happening today and I'm not sure if anybody else is having this same problem, if it may be related to a GitHub's API change or if it's just random, considering how this happens every other run.

Commits are not tracked

is it supposed to track commits or not?

I feel it might be interested to have "🔥 Created x commits in y" or something along those lines.

No PullRequest/Issue/IssueComment Fatal Error

I do not have anything in issues and issue comments, I get error fatal No PullRequest/Issue/IssueComment events found in the workflow. Seems like if you have not done pull requestsm issues, or issue comments, it crashes

Activity Not Updating - No Changes Detected

When I initially ran the workflow, it successfully updated my README; however, every subsequent workflow runs successfully but the file is no longer updated with my activity. Known of the changes are being found.

Run jamesgeorge007/github-activity-readme@master
⬤  debug     Getting activity for grantwforsythe
⬤  debug     Activity for grantwforsythe, 100 events found.
✔  success   No changes detected

What could be causing this issue?

Edit: The changes were being done to a private repo, that is why results were not recognizing the changes.

Add option to customize messages

It would be a great addition, if there was a way to customize the messages displayed and used within the readme file.

Imagine the following example settings:

name: Update README

on:
  schedule:
    - cron: '0 0 */1 * *' # Runs every day at 00:00
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    name: Update Profile README

    steps:
      - uses: actions/checkout@v2
      - uses: jamesgeorge007/github-activity-readme@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          COMMIT_MSG: "Update latest activity in README"

          COMMENT: "Commented on [{REPO}{ID}]({URL})"

          # PR Actions
          OPEN_PR: "Opened PR [{REPO}{ID}]({URL})"
          MERGE: "Merged Pull request [{REPO}{ID}]({URL})"
          CLOSE_PR: "Denied Pull request [{REPO}{ID}]({URL})"

          # Issue Actions
          OPEN_ISSUE: "Opened Issue [{REPO}{ID}]({URL})"
          CLOSE_ISSUE: "Closed Issue [{REPO}{ID}]({URL})"

{REPO} and {ID} are example placeholders and other syntaxes for them could be used. They essentially are replaced with the :user/:repository and issue/PR id (#:id) respectively.

The above example setup could result in the following 5 entries being displayed:

  1. Opened Issue jamesgeorge007/github-activity-readme#52
  2. Merged Pull request jamesgeorge007/github-activity-readme#41
  3. Commented on jamesgeorge007/github-activity-readme#52
  4. Denied Pull request jamesgeorge007/github-activity-readme#34
  5. Commented on jamesgeorge007/github-activity-readme#52

The above examples are taken from Pull requests and issues in this repository to give a better example of my point.
I really hope this can be implemented as it would allow a lot more customization of the displayed info and could allow to blend it into the style of your Readme a bit more.

The actions Error

Run jamesgeorge007/[email protected]
⬤ debug Getting activity for SatYu26
⬤ debug Activity for SatYu26, 100 events found.
✔ success Updated README with the recent activity
[master 4db681f] ⚡ update readme with the recent activity
1 file changed, 1 insertion(+), 1 deletion(-)
To https://github.com/SatYu26/SatYu26
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/SatYu26/SatYu26'
hint: Updates were rejected because the remote contains work that you do
⬤ debug Something went wrong
✖ fatal Error: Invalid status code: 1
at ChildProcess. (/home/runner/work/_actions/jamesgeorge007/github-activity-readme/v0.1.8/dist/index.js:1524:15)
at ChildProcess.emit (events.js:210:5)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Cron?

Why is this on a half hour cron, instead of a commit trigger?

workflow stopped with error

Do we need to comment or PR periodically to keep the workflow running?

"✖ fatal No PullRequest/Issue/IssueComment events found"

TIA

[BUG] or maybe I'm stupid?

I've tried to put this on my github profile but for some reason this doesn't doesn't show up on the readme. I tried to go through settings to see if anything is amiss but nothing seems to be.
I tweaked it a couple of times by trying the custom commit message code snippet instead of a regular one but no use.
Am I missing something or what?

PS: This is the first time I'm opening an issue in this repo & I've read the COC. Excuse me if the issue is not professional / doesn't match any standards.

MAX_LINES not working

I am trying to use the MAX_LINES within my action and it is stall outputting 5 instead of 10 that I have put within my code
steps:
- uses: actions/checkout@v2
- uses: jamesgeorge007/github-activity-readme@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
MAX_LINES: 10

Error in the workflow

It was working fine the last months but today it started failing
Do you have any idea why is this happening
image

[Bug] Activity seems to be several days out of date

Currently I have the action setup on my personal github profile and the activity updates appear a few days behind. I have manually re-run the pipeline and even tried deleting the section and hard resetting the content, but no luck.

In my case it seems to be 4 days behind current activity. I don't get an error message or any valuable logs from what I can tell, but here is a link to the most recent build.

Current Behaviour

  1. Activity pipeline activates
  2. Activity is several days old, and new activity is not displayed

Expected Behaviour

  1. Activity pipeline activates
  2. Activity displayed is up to date

Let users select update file

Firstly, I love this workflow. However, I have a suggestion to make:

My profile readme is derived from my TEMPLATE.md file in same repository.
So instead of updating README.md file, it'd be great if I'm able to update TEMPLATE.md file.

This will give flexibility to the the workflow.
Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.