Coder Social home page Coder Social logo

koh-sh / actbills Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 287 KB

This GitHub Action generates a markdown table of billable execution times for each workflow in a private GitHub repository.

License: MIT License

Makefile 3.16% Go 95.41% Dockerfile 1.34% Shell 0.09%

actbills's Introduction

actbills

This GitHub Action generates a markdown table of billable execution times for each workflow in a private GitHub repository. It provides an easy way to track and monitor the usage and costs associated with your GitHub Actions workflows.

Warning

  • GitHub Actions is free for public repositories. This action is only applicable to private repositories.
  • Execution times using Larger runners are not included in the aggregation.

Img

Features

  • Retrieves the billable execution times for each workflow in a private repository
  • Generates a markdown table summarizing the billable times for each workflow
  • Helps track and monitor the usage and costs associated with GitHub Actions workflows

Usage

To use this GitHub Action in your repository, follow these steps:

  1. Create a new file named .github/workflows/actbills.yml in your repository.
  2. Copy and paste the following YAML configuration into the actbills.yml file:
name: zzz_actbills

# run daily or dispatch.
# fix schedule for your needs
on:
  schedule:
    - cron: '0 0 * * *'
  workflow_dispatch:

# This action requires actions:read permission
permissions:
  actions: read

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: koh-sh/actbills@v0
  1. The schedule trigger is set to run the action daily at 00:00 AM UTC. You can modify the cron expression to adjust the schedule based on your requirements.
  2. The workflow_dispatch trigger allows you to manually run the action whenever needed.
  3. Commit and push the changes to your repository.
  4. After the action runs successfully, the markdown table with billable execution times will be generated and included in the action's summary.

Output

The generated markdown table will have the following format:

Workflow Ubuntu (min) Windows (min) Macos (min)
build on Ubuntu and Windows 6 3 0
test on Ubuntu 8 0 0
test on Windows 0 5 0
test on macOS 0 0 2
zzz_actbills 6 0 0

The table will include the name of each workflow and its corresponding billable execution time in minutes.

actbills's People

Contributors

koh-sh avatar dependabot[bot] avatar

Watchers

 avatar

actbills's Issues

Specification of Workflow Usage API about Larger runners is unknown

This tool uses this api endpoint.
https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#get-workflow-usage

But it doesn't mention about how billable time for larger runners are calculated.
https://docs.github.com/en/actions/using-github-hosted-runners/about-larger-runners/about-larger-runners#understanding-billing

If I find the specification, I think I can update this tool for actions which use larger runners.

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.