A GitHub Action that sets up and runs the Commands CLI tool in your workflow.
- Automatically configures Dart's pub-cache in your PATH
- Activates the Commands CLI from the Git repository
- Supports Git reference pinning (tags, branches, or commit hashes)
- Defaults to the latest release for stability
Use the latest release (recommended):
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- uses: Nikoro/setup-commands@v1
- name: Run commands
run: commandssteps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- uses: Nikoro/setup-commands@v1
with:
ref: '0.1.0'
- name: Run commands
run: commandssteps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- uses: Nikoro/setup-commands@v1
with:
ref: 'develop'
- name: Run commands
run: commandssteps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- uses: Nikoro/setup-commands@v1
with:
ref: 'abc123def456'
- name: Run commands
run: commands| Input | Description | Required | Default |
|-------|-------------|----------|---------||
| ref | Git reference of Commands CLI to activate. Accepts release tags (e.g., 0.1.0), branch names (e.g., main), or commit hashes. | No | Latest release |
This action requires Dart to be installed in your workflow. Use the dart-lang/setup-dart action to set up Dart:
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- uses: Nikoro/setup-commands@v1
- name: Run commands
run: commandsname: Run Commands CLI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
run-commands:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- uses: Nikoro/setup-commands@v1
with:
ref: '0.1.0'
- name: Run commands
run: commands- Path Configuration: Prepends
$HOME/.pub-cache/binto thePATHenvironment variable - Reference Resolution: If no ref is specified, fetches the latest release tag from the Commands repository
- Activation: Activates the Commands CLI using
dart pub global activatewith the specified Git reference - Ready to Use: The
commandsexecutable is now available in your PATH for subsequent steps
If you encounter any issues or have questions, please open an issue on GitHub.