athul / waka-readme

Wakatime Weekly Metrics on your Profile Readme.

Home Page:https://github.com/athul

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Readme stats generated but readme not updated

naveen8801 opened this issue · comments

commented

Description

image

As we can see in the logs stats were generated but the readme was not updated. I've followed all the steps to use this action. Link to my repo is here - link

https://github.com/naveen8801/naveen8801

That message "WakaReadme" is issued, if program is executed in --dev mode or if the stats has not changed.

waka-readme/main.py

Lines 412 to 423 in ac0bb21

if new_content := churn(readme_contents):
logger.debug('WakaReadme stats has changed')
gh_repo.update_file(
path=readme_file.path,
message=wk_i.commit_message,
content=new_content,
sha=readme_file.sha
)
logger.info('Stats updated successfully')
return
logger.info('WakaReadme was not updated')

But can you check your workflow permissions #114 (comment)?

commented

Hey @joe733 ,
image

Can you wait for a day or two? After WakaTime fetches new data, it should get populated automatically.

commented

yep sure @joe733 , thanks for helping 👍

Hi @naveen8801, in your profile README.md, you've given

<!--START_SECTION:SECTION_NAME -->
<!--END_SECTION:SECTION_NAME -->

SECTION_NAME is just a placeholder, instead if you provide, say:

<!--START_SECTION:stats-->
<!--END_SECTION:stats-->

SECTION_NAME must be set to stats in the waka-readme.yml file:

...
    steps:
      - uses: athul/waka-readme@master
        with:
          WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
          SHOW_TOTAL: true
          SECTION_NAME: "stats"
...

The default is waka, which if given in README, you do not need to set SECTION_NAME in the workflow.yml file.

<!--START_SECTION:waka-->
<!--END_SECTION:waka-->

Note: There is no space between waka or stats and the --> symbol (e.g. stats-->).

On another note, it's good that this issue cropped up. Couldn't have noticed this subtle behavior of the program otherwise. Now the README needs updating, logs, improving, and more tests, need writing :)

Anyway thanks for taking interest in the repository! Hope that resolves your issue.

commented

Hey @joe733, thanks for helping and I've made the above changes and it worked 😄