Mint Quickstart with GitHub

If you're not already familiar with Mint, you may want to start with the general getting started guide.

Install the Mint GitHub App

Install the Mint GitHub App:

https://github.com/apps/rwx-mint

This gives Mint access to read your repository contents, which is necessary to read the run definitions in your .mint directory. In addition, it gives Mint access to a few other permissions which are necessary to trigger your runs via webhooks and report statuses.

Run Definition

Create a simple run definition in the .mint directory, commit, and push it to your repository. Here’s an example:

on:
  github:
    push:
      init:
        commit-sha: ${{ event.github.push.head_commit.id }}

tasks:
  - key: echo-commit-sha
    run: echo ${{ init.commit-sha }}

GitHub Status Check

Take a look at the commit you just pushed in the GitHub UI; it should have a status associated with it from Mint. If you click the details link, it'll take you to the Mint UI where you can see the echo-commit-sha task.

Cloning Repositories

To clone your repository, Mint provides a token via secrets.

Look in your default vault:

https://cloud.rwx.com/mint/deep_link/vaults

You should see a secret named "*_CLONE_TOKEN where * is your GitHub organization in all uppercase.

You can use this token with the mint/git-clone leaf to clone your repository.

on:
  github:
    push:
      init:
        commit-sha: ${{ event.github.push.head_commit.id }}

tasks:
  - key: code
    call: mint/git-clone 1.1.0
    with:
      repository: [email protected]:YOUR_ORG/PROJECT.git
      ref: ${{ init.commit-sha }}
      github-access-token: ${{ secrets.YOUR_ORG_CLONE_TOKEN }}

For continuing to build a graph of tasks on top of your code task, see the documentation on use.