GithubHelp home page GithubHelp logo

judahpaul16 / clear-badge-cache Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 36.51 MB

Clear GitHub badge image cache with Go

Home Page: https://clear-badge-cache.com

License: GNU General Public License v3.0

Batchfile 10.58% Shell 5.40% Go 84.02%
cache golang badges shields curl image-cache readme cli github

clear-badge-cache's Introduction

Clear Badge Cache CLI ๐Ÿงนโœจ

Go Version Go Report Card GitHub Actions Workflow Status GitHub Website

Clear Badge Cache is a tool designed to purge cached GitHub badge images. Based on the repository URL and badge file, it will delete the cached image from the GitHub CDN.

Inspired by github-badge-cache-buster

There is a large list of bugs open (and incorrectly closed) relating to this. The main issue is

  • #224 - Aggressive image caching breaks image badges

Some of the others are.....

  • #9 - GitHub Image Proxy breaking Nodei.co images in markdown
  • #15 - Badges do not update with GitHubs caching
  • #111 - can't find the URL for this one
  • #116 - can't find the URL for this one
  • #134 - Serve cached images upon request timeout
  • #137 - Travis badges seem to be broken
  • #218 - GitHub caching affecting my badge
  • #220 - Set Cache-Control or Expires on S3 assets
  • #257 - Badge caching
  • #414 - Incorrect coverage badge
  • #1970 - Build status image cached by GitHub
  • #3122 - Code Coverage Status Badge is cached
  • #3150 - Unix nightly badge is inaccurate
  • #6040 - fix coveralls badge issue in README
  • #17057 - Aggressive GitHub caching breaks Gitlab badge images.

More information here.

Quick Start ๐Ÿš€

Prerequisites ๐Ÿ“‹

  • Go (1.22.2 or later)

Don't want to install Go? No worries; you can use the pre-built binaries in the dist directory using the same arguments as the Go program.

Installation ๐Ÿ› 

  1. Clone the repository:

    git clone
  2. Navigate to the project directory:

    cd clear-badge-cache
  3. Run the go file directly with or without arguments:

    go run main.go [repoURL] [badgeFile]

    If no arguments are provided, the program will prompt you to enter the repository URL. ๏ธ

Building ๐Ÿ”จ

Run the appropriate build script from the build-scripts directory for your operating system:

  • For Linux or MacOS, open your terminal and run:

    ./build-scripts/build.sh
  • For Windows, run the following in Command Prompt or PowerShell:

    .\build-scripts\build.bat

This will compile the source code and produce an executable in the dist directory.

Running ๐Ÿƒ

To run Clear Badge Cache, navigate to the dist directory and execute the binary:

  • Linux/MacOS:

    sh ./clear-badge-cache.sh
  • Windows:

    .\clear-badge-cache.exe

Command Line Arguments ๐Ÿ–Š๏ธ

You can provide the repository URL and optionally a badge file as command-line arguments:

clear-badge-cache [repoURL] [badgeFile]

If no arguments are provided, the program will prompt you to enter the repository URL.

Help

To display the help message, use the -h or --help flag:

clear-badge-cache -h

The help message is as follows:

usage: clear-badge-cache [ -h | --help | [ repoURL [ badgeFile ] ] ]

       repoURL   required unless provided on command line
       badgeFile defaults to ''

Contributing ๐Ÿค

Contributions are what make the open-source community great. Any contributions you make are much appreciated.

License ๐Ÿ“

Distributed under the GNU GPL-3 License. See LICENSE for more information.

clear-badge-cache's People

Contributors

judahpaul16 avatar

Stargazers

 avatar

Watchers

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