Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

meetuparchive/express-checkout

Repository files navigation

⚠️ Note: GitHub actions/checkout@v2 has made big leaps and is now comparably fast compared to meetup/express-checkout. Use that instead.

💳 :octocat:

express checkout

A GitHub Actions checkout action that's fast for git repositories of all shapes and sizes

  Coverage Status

⚠️ Note: To use this action, you must have access to the GitHub Actions feature. GitHub Actions are currently only available in public beta. You can apply for the GitHub Actions beta here.

🏃‍♀️ Fast you say?

Unfortunately, not all code repositories are small. For organizations that structure code within mono repositories, you can find yourself in situations where simply cloning your repository can become an obstacle for fast continuous integration. In a stateless and serverless continuous integration system like GitHub Actions you want this to be as fast as possible. This is the goal of this GitHub action.

We quick realized this with some of our most important repositories when trialing GitHub actions, the default checkout action was less than ideal.

name: CI
jobs:
  test:
    steps:
      - uses: actions/checkout@v1
        with:
          fetch-depth: 1

Would take upwards of 6 to 7 minutes before CI could do anything useful. With express-checkout, we've got that down to 1.

🤸 usage

In a workflow for example, say .github/workflows/ci.yml add the following.

name: CI
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: meetup/express-checkout@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: Test
        run: echo ⭐ ⭐ ⭐

⛏️Digging deeper

⚠️ Note: For private repositories you will want to create a new secret to store a personal access token with repo permissions. GitHub actions default GITHUB_TOKEN secret does not have the permission to clone your private repository.

This action will attempt to checkout a specific commit within a branch that triggered the action. To do so, it may need to "deepen" the shallow checkout. This will by default deepen the checkout to 100. However, you can provide a custom max_depth to limit the amount of depth this action will dig for your commit.

name: CI
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: meetup/express-checkout@master
        with:
          max_depth: 5
        env:
          GITHUB_TOKEN: ${{ secrets.CLONE_TOKEN }}
      - name: Test
        run: echo ⭐ ⭐ ⭐

🗣️shoutouts

This action was inspired in part by @zoispag's comments here as well as the Concourse CI Git Resource.

Meetup Inc 2019

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published