Skip to main content

Logs statistics for specific commits in CSV form and optionally sends them as JSON to a web api.

Project description

gitcommitlogger

A Python package that logs the details of a specific set of events made to a GitHub repository. Logs are saved into a CSV file and can optionally be sent in a request to a web app, such as a Google Apps Script attached to a Google Sheet where the data can be stored.

GitHub Actions integration

This package is designed to be used in a GitHub Actions workflow, where the workflow is triggered by a push or pull request to the repository. Details of the commits included in the push will then be logged.

A sample GitHub Actions workflow is included in .github/workflows/event-logger.yml. This example stores the logs into a Google Sheet by first posting them as JSON data to a web app attached to the Google Sheet. The URL of the web app is presumed be stored in a GitHub Actions Secret named COMMIT_LOG_API.

Google Apps Scripts integration

In order to save the logs into a Google Sheet, the following steps are required:

  • Create a Google Sheet.
  • Attach an Apps Script to the sheet by clicking the Extensions->Apps Scripts menu option in Google Sheets.
  • Copy/paste the example Apps Script in apps-script-example/code.js into the Apps Script editor and save. This sets up the script as a web app so it can respond to GET or POST requests.
  • Click the buton to Deploy->New Deployment in the Apps Scripts editor. Note the web app URL that is generated once deployed.
  • Add the URL of the Apps Script web app to the GitHub repository as a secret named COMMIT_LOG_API.
  • The gitcommitlogger command in the example GitHub Action will send a POST request to the Google Sheet web app whenever a push or pull request is made on the repository.
  • The web app will then add a row to the Google Sheet with the details of the commit, including the commit id, author, number of files changed in the commit, number of lines added and deleted.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitcommitlogger-1.2.6.tar.gz (45.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitcommitlogger-1.2.6-py3-none-any.whl (31.8 kB view details)

Uploaded Python 3

File details

Details for the file gitcommitlogger-1.2.6.tar.gz.

File metadata

  • Download URL: gitcommitlogger-1.2.6.tar.gz
  • Upload date:
  • Size: 45.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gitcommitlogger-1.2.6.tar.gz
Algorithm Hash digest
SHA256 62d178ff69b3977deaddb366619e542a2537bf737bd6ddca2597ea07eaa4560e
MD5 698a70bea3724d4f648341d403171a7a
BLAKE2b-256 51f6c8002e08e9c91ec7756445413d3e3b40b1ef58d3679b26a4901db08ccaa7

See more details on using hashes here.

File details

Details for the file gitcommitlogger-1.2.6-py3-none-any.whl.

File metadata

File hashes

Hashes for gitcommitlogger-1.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 816fa145fdb4c751757825e47fd449d85d91cf81111afde5cc838cac5babfe4a
MD5 b2bc78eaa4f6f8d5befcf51260ded17b
BLAKE2b-256 1bea628c05172183b1f3c4175f6cbe387a5fcea25201603f7b003da0d30783b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page