Skip to content

Instantly share code, notes, and snippets.

@antfu
Last active November 20, 2023 10:25
Show Gist options
  • Save antfu/97b738c515448231e85fc48014be5b3b to your computer and use it in GitHub Desktop.
Save antfu/97b738c515448231e85fc48014be5b3b to your computer and use it in GitHub Desktop.
๐Ÿ“Š Weekly development breakdown
TypeScript 21 hrs 47 mins โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–’โ–‘โ–‘โ–‘ 67.1%
Vue.js 6 hrs 21 mins โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 19.6%
JSON 2 hrs 10 mins โ–ˆโ–ˆโ–ˆโ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 6.7%
JavaScript 46 mins โ–ˆโ–ˆโ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 2.4%
@FyisFe
Copy link

FyisFe commented May 26, 2021

Have some issues here. After I triggered the action, the file within the gist was deleted, and the title of it turned to gist:<:id>. Triggered the action again, and the console output:

Unable to update gist
HttpError: Validation Failed: {"resource":"Gist","code":"missing_field","field":"files"}

Additional info:
Already has data in the Wakatime Dashboard.
Already checked all profile setting https://wakatime.com/settings/profile.

Maybe I should wait a couple of days to ensure the Wakatime has enough data?

It works now, just needs to be patient haha.

@iTonyYo
Copy link

iTonyYo commented Jun 3, 2021

ๅฆ‚ๆžœๆ นๆฎ matchai/waka-box ็š„ README.md ๆฒก่ƒฝๆˆๅŠŸๅฎž็Žฐ๏ผŒๅฏไปฅๆŒ‰็…งๆŽฅไธ‹ๆฅ็š„ๆ“ไฝœ๏ผŒ

  • matchai/waka-box ๅฎšไน‰็š„่ฎกๅˆ’ไปปๅŠก้ข‘็Ž‡๏ผšๆฏๅคฉ้›ถ็‚นๆ‰ง่กŒไธ€ๆฌกใ€‚ๆ‰€ไปฅๅˆซๆœŸๆœ›ๆŽจ้€ไปฃ็ ๅŽๅฐฑ่ƒฝ็œ‹ๅˆฐๆœ€็ปˆๆ•ˆๆžœ๏ผ›
  • ไฟฎๆ”น fork ๅŽ้กน็›ฎๅ†…็š„ schedule.yml ้…็ฝฎ๏ผ›
name: Update gist with WakaTime stats
on: 
  schedule:    
    - cron: "0 0 * * *"
jobs:  
  update-gist: 
    runs-on: ubuntu-latest
    steps: 
      - uses: actions/checkout@master      
      - name: Update gist        
-       uses: matchai/waka-box@master 
+       run: node ./dist/index.js
        env:           
           GH_TOKEN: ${{ secrets.GH_TOKEN }} 
           GIST_ID: 968220c97e8da1d047a9a480fa432e54 
           WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
  • ๆœ‰้œ€่ฆ๏ผŒๅฏไปฅ่ฐƒๆ•ด่ฎกๅˆ’ไปปๅŠก้ข‘็Ž‡๏ผŒๅฆ‚๏ผšๆฏไธคๅฐๆ—ถๆ‰ง่กŒไธ€ๆฌกใ€‚่ฟ™ไธชๆ“ไฝœๅนถ้žๅฟ…้กป็š„ใ€‚ๆณจๆ„๏ผŒGithub Actions ๆ”ฏๆŒ็š„ๆœ€ๅฐ้ข‘็Ž‡ๆ˜ฏ๏ผšๆฏ 5 ๅˆ†้’Ÿ๏ผ›
name: Update gist with WakaTime stats
on: 
  schedule:    
- - cron: "0 0 * * *"
+ - cron: "0 */2 * * *"
jobs:  
  update-gist: 
    runs-on: ubuntu-latest
    steps: 
      - uses: actions/checkout@master      
      - name: Update gist        
           run: node ./dist/index.js
        env:           
           GH_TOKEN: ${{ secrets.GH_TOKEN }} 
           GIST_ID: 968220c97e8da1d047a9a480fa432e54 
           WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}

ๅšๅฎŒ่ฟ™ไบ›ๅฐฑๆฒก้—ฎ้ข˜ไบ†๏ผŒๅˆฐๆ—ถ้—ดๅฐฑๅฏไปฅ็œ‹ๅˆฐๆ•ˆๆžœใ€‚

@iTonyYo
Copy link

iTonyYo commented Jun 3, 2021

If it fails to be implemented according to matchai/waka-box README.md, it can be implemented according to the following operations.

  • Defined scheduled task frequency in matchai/waka-box: once every day at 0: 00. So don't expect to see the final effect after pushing the code;
  • Modify the schedule.yml configuration in the project after fork
name: Update gist with WakaTime stats
on: 
  schedule:    
    - cron: "0 0 * * *"
jobs:  
  update-gist: 
    runs-on: ubuntu-latest
    steps: 
      - uses: actions/checkout@master      
      - name: Update gist        
-       uses: matchai/waka-box@master 
+       run: node ./dist/index.js
        env:           
           GH_TOKEN: ${{ secrets.GH_TOKEN }} 
           GIST_ID: 968220c97e8da1d047a9a480fa432e54 
           WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
  • If necessary, you can adjust the frequency of scheduled tasks, for example, once every two hours. This operation is not necessary, the minimum frequency is: every 5 minutes;
name: Update gist with WakaTime stats
on: 
  schedule:    
- - cron: "0 0 * * *"
+ - cron: "0 */2 * * *"
jobs:  
  update-gist: 
    runs-on: ubuntu-latest
    steps: 
      - uses: actions/checkout@master      
      - name: Update gist        
           run: node ./dist/index.js
        env:           
           GH_TOKEN: ${{ secrets.GH_TOKEN }} 
           GIST_ID: 968220c97e8da1d047a9a480fa432e54 
           WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}

When you finish these, there will be no problem, and you will see the effect in time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment