GitHub Actions

See the GitHub action here.

Set up Score with GitHub Actions

Score is a CLI tool that helps manage developer workloads. Here is how to set up Score in your GitHub actions workflow.

Usage

To use the Score GitHub action, add the following step to your workflow:

steps:
  - uses: actions/setup-score@v2
    with:
      file: score-humanitec
      version: '0.1.0'

This will download and cache the specified version of the score-humanitec CLI and add it to $PATH.

The action accepts the following inputs:

  • file - The Score CLI tool to install. Supported options are score-compose, score-humanitec, or score-helm. Required.
  • version - The version of the CLI to install. Supports semver ranges. Required.

Examples

Using a pinned version

Here is a complete example workflow:

name: Score Example

on: push

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Set up Score
      uses: actions/setup-score@v2
      with:
        file: score-humanitec
        version: '0.1.0'

    - name: Check version
      run: score-humanitec --version

This installs version 0.1.0 of score-humanitec, adds it to $PATH, and runs score-humanitec --version to verify it is set up correctly.

The action caches the Score binary so it won’t need to download it each run.

Now Score is installed and ready for use in any downstream steps.

Using the latest version

While pinning the version of score-humanitec is good practice, here is the same example workflow using the latest version if that is what you require:

name: Score Example

permissions:       # Added
  contents: read   # Added

on: push

jobs:
  test:
    runs-on: ubuntu-latest
    
    steps:
    - uses: actions/checkout@v2

    - name: Set up Score
      uses: actions/setup-score@v2
      with:
        file: score-humanitec
        token: ${{ secrets.GITHUB_TOKEN }} # Added
        version: 'latest'                  # Modified

    - name: Check version
      run: score-humanitec --version

Setting the token is required when the latest version is used. It is obtained using GitHub Automatic token authentication.

The action needs the token to pull the latest release details via the GitHub API. The token must have the contents: read permission for this kind of access.

Top