npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

migrate-greenkeeper-to-dependabot-cli

v1.0.0

Published

CLI to migrate all repositories for a given owner

Downloads

4

Readme

Migrate Greenkeeper to Dependabot

CLI to migrate all repositories for a given owner

Background

Greenkeeper was acquired and will stop working after June 3rd.

If you plan to migrate your repositories to GitHub's own Dependabot, then this CLI is for you.

There are a few trade-offs to consider

  • Dependabot has been created with a focus on apps, not libraries. By default, Dependabot sends updates for all dependency updates, including updates that are within the range of what's defined in package.json's "dependencies" and "devDependencies". There will be many more pull requests coming from Dependabot compared to Greenkeeper
  • One of my favorite features of Greenkeeper is live monitoring of in-range dependency updates. It creates a branch, which triggers the CI but does not create any notifications. If CI passes, the branch is deleted again. But if it fails, Greenkeeper creates an issues, so the maintainers can pin the version of the affected dependency, in order to prevent sudden breaking changes for its dependands. See https://greenkeeper.io/docs.html#greenkeeper-step-by-step
  • Starting with the upcoming Dependabot v2, live updates will no longer be supported. All updates must happen on a defined schedule.

Usage

Create a personal access token at https://github.com/settings/tokens/new?scopes=repo

GITHUB_TOKEN=... npx migrate-greenkeeper-to-dependabot --owner octokit

What it does

I've made this script for my specific needs. If you have different needs, I suggest you fork it, I'm not sure if it's worth sending pull requests for a one-of CLI, but do what yuo think is best :)

  1. Looks for all repositories for the provided owner

  2. In each repository it looks for a Greenkeeper badge. If it doesn't find one, the repository is ignored.

  3. For each remaining repository, it creates a pull request with the following changes

    1. It removes the Greenkeeper badge

    2. It updates Action workflow files. It looks for the on.push.branches array. If it finds any string starting with greenkeeper/..., it replaces it with dependabot/npm_and_yarn/...

    3. It creates a .github/dependabot.yml file with the following configuration

      version: 2
      updates:
        - package-ecosystem: "npm"
          directory: "/"
          schedule:
            interval: "daily"
          labels:
            - "maintenance"
    4. It adds a "maintenance" label on the pull request

LICENSE

ISC