Skip to content

patrykacc/sf-cli-setup

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SF (SFDX) CLI Setup - Github Action

Easily setup and cache SF CLI

Main: Health check

Action provides easy way to start working with sf cli in your GitHub workflows. Installing cli using this action is much more effective than using the sfdx docker container. Action characteristics:

  • easy to use - 1 line to install and cache the latest version of CLI
  • very fast thanks to implemented auto-caching
  • easy to switch between different CLI versions when needed
  • running on runner directly allows to use runner preinstalled tools, eg. java, chromium, node
  • covered by extensive unit tests to achieve the confidence of stability

Quickstart:

Put this line into job in your workflow:

- uses: patrykacc/[email protected]

Example:

on:
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: patrykacc/[email protected]
      - name: CLI Health check
        run: |
          echo "CLI Installed succesfuly!"
          sf -v

Result:
image

By default, the action installs the latest version of CLI and cache it under specific version key. If you require any other specific version of CLI to be installed, there is version input provided, where you can specify which exactly version should be installed.

    - name: Install CLI
      uses: patrykacc/[email protected]
      with:
        version: 2.55.0

You can easily externalize to GitHub setup the configuration, so you can manage CLI versions, without code modifications:

    - name: Install CLI
      uses: patrykacc/[email protected]
      with:
        version: ${{ vars.SF_CLI_VERSION }} # eg. 'latest'

Cache example:

img.png

If my work is helpfull for you simply click star button - it gives a lot of fuel to bring more actions for our Salesforce community!

patrykacc - sf-cli-setup

Released under MIT by @patrykacc.

About

Github Action - Easy SFDX CLI setup and cache

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published