Code Monkey home page Code Monkey logo

Comments (5)

rednafi avatar rednafi commented on August 24, 2024 1

Version 0.2.0 now:

  • Fetches forked repos based on pushed_at || updated_at || created_at date.

  • Lists the forked repositories that will and won't be deleted:

    fork-sweeper --owner rednafi --token $GITHUB_TOKEN --older-than-days 0

    This returns:

    Fetching forked repositories for rednafi...
    
    Guarded forked repos [won't be deleted]:
    
    Unguarded forked repos [will be deleted]:
        - https://github.com/rednafi/cpython
        - https://github.com/rednafi/dysconfig
        - https://github.com/rednafi/pydantic
  • Explicitly filter out forked repositories with fuzzy name matching:

    fork-sweeper --owner "rednafi" --token $GITHUB_TOKEN --older-than-days 0 --guard 'py'

    This prints:

      Fetching forked repositories for rednafi...
    
      Guarded forked repos [won't be deleted]:
          - https://github.com/rednafi/cpython
          - https://github.com/rednafi/pydantic
    
      Unguarded forked repos [will be deleted]:
          - https://github.com/rednafi/dysconfig

from fork-sweeper.

Crocmagnon avatar Crocmagnon commented on August 24, 2024 1

Nice ! πŸ˜€
I think however the biggest value would come from an "open PR" guard. It may require some more work though as I don't know if this information can easily be obtained with GitHub's API.
Also, listing why repos are protected would be a good addition too IMO.

from fork-sweeper.

rednafi avatar rednafi commented on August 24, 2024

Thank you for the ideas; they are great!

I really like the idea of deleting repositories based on the last activity date, rather than the creation date. This can be done without changing the external flag.

Also, a --protect flag that will take a list of repositories sounds useful.

I'll start tackling tasks from the lowest level of complexity to the highest. Also, feel free to open a PR if you have strong opinions about the implementation.

from fork-sweeper.

rednafi avatar rednafi commented on August 24, 2024

Yeah, a PR guard would be nice I agree. But at the same time, it's hard to track that without consuming some event.

Listing why a repo was filtered out seems like an easy low-hanging fruit.

from fork-sweeper.

Crocmagnon avatar Crocmagnon commented on August 24, 2024

After doing some exploration, it looks like the open PR feature can be implemented quite easily with the GraphQL API but would require several calls with the REST API.
There’s a discussion on the refined-github repo about this, specifically this comment: refined-github/refined-github#2268 (comment)

from fork-sweeper.

Related Issues (5)

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.