Setup

Sprkl Reviewer

Install the Sprkl Reviewer app from the GitHub marketplace and follow the instructions, and receive an access token.

Add the token as a secret to your repository

1. Open your repo on GitHub.

2. Go to Settings

3. Then, go to Secrets

4. in Action, select New Repository Secret

Enter the token provided to you by Sprkl under any name you'd like.

Sprkl Action

Setup Sprkl in your GitHub Workflow

Add the following step to make Sprkl CLI available in your workflow:

      - name: Sprkl Setup
        uses: sprkl-dev/sprkl-action/setup@master
        with:
          token: ${{ secrets.SPRKL_GITHUB_ACTIONS_TOKEN }}

Since Sprkl analyzes your git history (Why?) during the workflow, so make sure to include it in your action by setting fetch-depth: 0 in actions/checkout.

      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
          
      - name: Sprkl Setup
        uses: sprkl-dev/sprkl-action/setup@master
        with:
          token: ${{ secrets.SPRKL_GITHUB_ACTIONS_TOKEN }}

Get your token by setting up the Sprkl Reviewer.

Details are down below.

Example

     
      # Modify the checkout step to use "fetch-depth: 0",
      # which fetches all the git history into that workflow.
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
          

      # Setup Sprkl CLI in the workflow
      - name: Sprkl Setup
        uses: sprkl-dev/sprkl-action/setup@master
        with:
          token: ${{ secrets.SPRKL_GITHUB_ACTIONS_TOKEN }}
          
      # `sprkl` is now available throughout the entire workflow.
      
      - name: Install
        run: npm install
        
      - name: Test
        run: sprkl -- npm test

Follow the example action in the sprkl example repository - a real use-case of microservices e-commerce.

Last updated