banish

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2023 License: MIT Imports: 12 Imported by: 0

README


King Lear disowns Cordelia

Banish

A Go tool for scanning organisation repositories for blacklisted modules

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Installation
  3. Usage
  4. Contributing
  5. License
  6. Contact

About The Project

Screenshot

When maintaining lots of repos, it is often necessary to find a list of repos containing modules that have out-of-date dependencies. This tool will scan all of an organisation's repos looking for go.mod files, and will parse those files looking for modules that need to be removed or updated.

Here's why:

  • You have updated a module with a breaking change, and want to ensure that all projects that depend upon it have been updated
  • You have identified a security, license, or some other issue with a dependency and with to make sure that none of your repos depend upon it (including at least one step indirectly)
  • You have tried to use GitHub's search to help find these issues and value your sanity enough to use some proper tooling instead 😄

(back to top)

Installation

Use go install.

go install github.com/humn-ai/banish@latest

(back to top)

Usage

Running banish without any arguments will output usage information.

A simple scan of all repositories might look like this:

banish -github-token <your token> -org humn-ai -modules github.com/gogo/protobuf

Multiple repositories can be provided with CSV, and minimum versions can be provided with @:

banish \
    -github-token <your token> \
    -org humn-ai \
    -modules github.com/gogo/protobuf,github.com/rs/zerolog@1.0.0

To use a file with a line for each entry to search for, standard POSIX comes in handy. Also note that an environment variable of GITHUB_TOKEN can be used to improve the security of your token handling. Here pass is used to store a token encrypted and avoid leaving it laying around in terminal history or environment variables, and a line-by-line blacklist file is converted to CSV:

GITHUB_TOKEN=$(pass tokens/github-ro) banish \
    -org humn-ai \
    -modules $(cat blacklist.txt | tr '\n' ',')

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue. Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Project Link: https://github.com/humn-ai/banish

Humn - https://www.humn.ai

John Anthony - https://jo.hnanthony.com - john.anthony@humn.ai, john@jo.hnanthony.com

(back to top)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL