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

bitbucket-build-status-hook

v0.0.5

Published

A post-checkout hook for checking commit build status via the Bitbucket REST API.

Downloads

9

Readme

Bitbucket Build Status Hook

This Git post-checkout hook displays the latest Bitbucket Cloud build status for a commit when you check it out in your terminal. This allows you to quickly tell if your feature branch is failing, or whether it's safe to create a new branch from master!

Usage

This tool is most useful when symlinked as a post-commit hook, which runs every time you check out a branch or commit:

post-checkout hook in action

But you can also manually run bitbucket-build-status to check the build status of any branch, commit, or commit-ish, at any time.

bitbucket-build-status in action

Installation

  1. Install Node.js
  2. Run npm install -g bitbucket-build-status-hook
  3. Navigate to the root of a Git repository that you've cloned from Bitbucket
  4. Run ln -s /usr/local/bin/bitbucket-build-status .git/hooks/post-checkout
  5. Run git checkout HEAD to test that the hook is properly installed

Credential management

The first time you upload a file you will be prompted for your Bitbucket email and password. These will be used to retrieve an OAuth refresh token which is stored in ~/.bitbucket-build-status and used for subsequent requests. Treat this token carefully as it can be used to read repository data on your behalf.

2FA/U2F

If you have 2FA enabled for your Bitbucket account, the client will be unable to use OAuth to authenticate you. Instead, you'll need to configure a Bitbucket App Password for the client to use. To do this:

  1. create an App Password with Read access to your repositories
  2. create a file at ~/.bitbucket-build-status-hook containing:
{
    "bitbucket.org": {
        "username": "your-username" // (*not* your email address),
        "password": "your-app-password"
    }
}

Bitbucket developers

By default, the API is assumed to live at api.$domain_of_repo_origin. This is not true for developing against staging.bb-inf.net or localhost. To remap the API, copy .bitbucket-build-status-hook.sample to ~/bitbucket-build-status-hook.

{	
	"staging.bb-inf.net": {
		"username": "kannonboy",
		"password": "password",
		"apiDomain": "api-staging.bb-inf.net"
	}
}

For localhost or other Bitbucket Cloud hosts, update staging.bb-inf.net and apiDomain as appropriate.