GithubHelp home page GithubHelp logo

label_timer's Introduction

label_timer

日本語

Measures how long a given label has been attached to an issue or pull request.

Usage

example.yml

name: Timer
on:
  # For pull request labels
  issues:
    types:
      ['labeled', 'unlabeled'].
  # For pull request labels
  pull_request:
    types:
      ['labeled', 'unlabeled']
jobs:
  timer:
    runs-on: ubuntu-latest
    steps:
      - name: test_run
        uses: tbsmcd/[email protected]
        id: test_run
        with:
          # You can specify multiple labels separated by commas.
          targets: 'responding, requesting, needs_review'
          token: ${{ secrets.GITHUB_TOKEN }}
      # If you want to use the measurement results in later steps
      - name: checkout
        if: ${{ github.event.action == 'unlabeled' && github.event.label.name == 'responding' }}
        uses: actions/checkout@v2
      - name: add_time_label
        if: ${{ github.event.action == 'unlabeled' && github.event.label.name == 'responding' }}
        # outputs can be obtained as the following variables.
        #
        # If `github.event.action == labeled`.
        # ${ steps.test_run.outputs.url }} URL of the issue or pull request that was targeted.
        #
        # If `github.event.action == unlabeled`.
        # ${ steps.test_run.outputs.url }} URL of the issue or pull request that was targeted
        # ${ steps.test_run.outputs.passed_seconds }} Number of seconds between label assignment and removal
        # ${ steps.test_run.outputs.sum_seconds }} Number of seconds between labeling and deletion (total)
        run: |
          pip install requests
          python .github/example.py ${{ secrets.GITHUB_TOKEN }} ${{ github.event.issue.url }} ${{ steps.test_run.outputs.sum_seconds }}

How is it measured?

screenshot 2021-03-10 0 56 21

When the target label is added, the measurement label will be added to the issue/pull request. When the target label is removed, the measurement label is also removed and the measurement result is commented. If the target label is added or removed multiple times, the total time will be commented.

Get the result

In the following steps and jobs, you can get URL of issue/pull request, the number of seconds between when the label was added and when it was removed, and the total time.

Usage example

  • Measure the lead time from review request to review completion for pull requests.
  • Measure the lead time from request to completion for Ops tasks.

The results can be referenced later in steps / jobs as outputs variables, so you can save them to BigQuery or a spreadsheet.

label_timer's People

Contributors

tbsmcd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

label_timer's Issues

中断を考える

「対応中」ラベルを付けていて途中で別の作業をしたときどうするの?というテーマ。
中断中ラベルなどのアイデアはあり。

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.