Giter VIP home page Giter VIP logo

branch-lifetime's Introduction

Branch lifetime action

Summary

This action calculates a lifetime of the branch of the pull request. You can specify the unit of the action output from hour(default), minute or second.

Note

If this action is triggered by events except pull_request, all calculation will be skipped and outputs will be empty.

Setup

on:
  pull_request:
    # if you want to check lifetime at only closing PR, remove 'opened' and 'synchronize'.
    types: [opened, synchronize, closed]

jobs:
  call-as-actions:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: gki/branch-lifetime@v1
        id: lifetime
        with:
          # You can set 'hour' or 'minute' as well. Default is 'hour'.
          unit: second
      - name: "Use output"
        run: |
          echo "${{ steps.lifetime.outputs.lifetime }}"
          echo "${{ steps.lifetime.outputs.unit }}"

Why checking branch lifetime?

According State of DevOps and the book "Accelerate", the four metrics are super important for today's software project.

  • Deployment Frequency
  • Cycle Time (Change Lead Time)
  • Mean Time to Recovery (MTTR)
  • Change Failure Rate

Ideally, we should measure them from day one, but it's unrealistic since they are related to the production release. However, it should be nice if we can track one of the similar metrics as soon as possible.

To do that, let's see 'Deployment Frequency' and 'Cycle Time'. They are normally tracked by a ticket (maybe), but they include a time between the first commit of a branch and the merge of the branch, and that time, the branch lifetime, will be the greater part of them.

If any other part is bigger than the branch lifetime, yes, it's problematic. But to notice that, checking branch lifetime should help you.

That's why I created this action. I think this tool doesn't directly give an insight of our project health, the lifetime will be unstable in the very first period. I will use this tool by myself and would like to try to get something from this metric as a one of the users. ๐Ÿคž

branch-lifetime's People

Contributors

gki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.