Giter Club home page Giter Club logo

daily-code-stats's Introduction

Daily Codes Stats

A Nodejs script to count your daily codes, and it will auto-update daily code stats on your README.md.

You can use this action to your homepage repo, and it will update your README.md every day. Example: Talljack

Usage

name: daily-code-stats
on:
  schedule:
    - cron: '0 0 * * *' # 每天运行一次
jobs:
  daily-code-stats:
    runs-on: ubuntu-latest
    steps:
      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '18'

      - name: Daily Codes Stats
        uses: Talljack/daily-code-stats@main

        env:
          token: ${{secrets.GITHUB_TOKEN}} # 使用存储在仓库 Secrets 中的 GitHub 令牌

      - name: Commit files
        id: commit-files
        run: |
          if [ -n "$(git status --porcelain README.md)" ]; then
            git config --local user.email "github-actions[bot]@users.noreply.github.com"
            git config --local user.name "github-actions[bot]"
            git add README.md
            git commit -m "Update README.md"
            echo "hasChange=true" >> $GITHUB_OUTPUT
          else
            echo "No Changes"
          fi

      - name: Push changes
        uses: ad-m/github-push-action@master
        if: ${{ steps.commit-files.outputs.hasChange == 'true' }}
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          branch: ${{ github.ref }}

Usually, you can add this action to your homepage repo, and it will update your README.md every day.

Talljack daily code

Inputs

  • token - Your GITHUB_TOKEN. This is required. Why do we need a token? Read more here: About the GITHUB_TOKEN secret. Default: ${{ github.token }}

Outputs

  • dailyCodeInfo - The daily code info. JSON string. Example: {"username": "Talljack", "2023-12-06": {"additions": 66, "deletions": 66}}

License

Licensed under the MIT License.

Talljack Daily Code Statistics

Date Addition Codes Deletion Codes
2024-04-26 3287 291

daily-code-stats's People

Contributors

github-actions[bot] avatar talljack avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar

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.