-
Notifications
You must be signed in to change notification settings - Fork 1
docs: add setup-kosli-cli GitHub Action reference page #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7111917
66da500
fa214f9
9e7a121
ea40afa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| --- | ||
| name: "Update GitHub Action reference" | ||
| on: | ||
| cron: "0 9 * * 1" | ||
| context: | ||
| - repo: "kosli-dev/setup-cli-action" | ||
| notify: | ||
| slack: | ||
| channels: | ||
| - docs | ||
| --- | ||
|
|
||
| # Agent Instructions | ||
|
|
||
| Check kosli-dev/setup-cli-action for **new tags/releases** published since the last time the GitHub Action reference page was updated. The action uses semver GitHub Releases (e.g., `v5.2.1`) with moving major/minor tags (`v5`, `v5.2`). Check the Releases list for new versions. Only consider changes that are part of a published release — do not include unreleased work on `main`. | ||
|
|
||
| If no new releases exist since the last update, do not open a PR. | ||
|
|
||
| Keep the GitHub Action reference in `github-action-reference/setup_cli_action.md` in sync with the action's [`README.md`](https://github.com/kosli-dev/setup-cli-action/blob/main/README.md) and [`action.yml`](https://github.com/kosli-dev/setup-cli-action/blob/main/action.yml), which are the source of truth. Update the page when any of the following change: | ||
|
|
||
| 1. **Inputs** — an input is added, removed, renamed, or its accepted values or default change (e.g., `version`, `github-token`). | ||
| 2. **Outputs** — an output is added, removed, or its meaning changes (e.g., `version`). | ||
| 3. **Version selection behavior** — how `latest`, full semver, and major/minor pins resolve. | ||
| 4. **Supported runners** — the set of runners the action supports (`ubuntu-latest`, `windows-latest`, `macos-latest`). | ||
| 5. **Usage** — the recommended major version in the `uses:` examples (e.g., `@v5`) or the example workflows. | ||
|
|
||
| Most releases of this action are Dependabot or internal chore bumps. Those do not change the documented interface — if a release does not affect inputs, outputs, behavior, supported runners, or usage, do not open a PR for it. | ||
|
|
||
| When updating the page: | ||
| - Follow Mintlify formatting conventions. Review the existing `github-action-reference/setup_cli_action.md` and other reference pages for style reference. | ||
| - Use root-relative links (e.g., `/integrations/ci_cd`, `/client_reference`). | ||
| - Keep the page a terse reference: inputs/outputs tables, version-selection rules, and usage examples. | ||
|
|
||
| Do not modify changelog/index.mdx — that is handled by the "Update changelog" workflow. | ||
|
|
||
| Before opening a PR, review all written content against the style rules in `styles/Kosli/`. In particular, `AmericanSpelling.yml` maps British spellings to their American equivalents — use American spelling throughout (e.g., "behavior", "customize", "organize"). | ||
|
|
||
| PR titles and commit messages must follow the conventional commits format described in CLAUDE.md. Use `docs:` as the type. |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,120 @@ | ||||||||||||
| --- | ||||||||||||
| title: GitHub Action | ||||||||||||
| description: Reference for the setup-kosli-cli GitHub Action that installs the Kosli CLI on GitHub Actions runners. | ||||||||||||
| icon: github | ||||||||||||
| --- | ||||||||||||
|
|
||||||||||||
| The [`kosli-dev/setup-cli-action`](https://github.com/kosli-dev/setup-cli-action) GitHub Action (`setup-kosli-cli`) installs the [Kosli CLI](/client_reference) on GitHub Actions runners. After the action runs, every CLI command is available in later steps of the job. | ||||||||||||
|
|
||||||||||||
| The action runs on `ubuntu-latest`, `windows-latest`, and `macos-latest` runners. | ||||||||||||
|
|
||||||||||||
| <Note> | ||||||||||||
| This page documents the action itself. For a broader guide to using Kosli in GitHub Actions, including the command flags that are defaulted from GitHub CI variables, see [CI/CD](/integrations/ci_cd). | ||||||||||||
| </Note> | ||||||||||||
|
|
||||||||||||
| ## Usage | ||||||||||||
|
|
||||||||||||
| Install the latest release of the Kosli CLI: | ||||||||||||
|
|
||||||||||||
| ```yaml | ||||||||||||
| steps: | ||||||||||||
| - uses: kosli-dev/setup-cli-action@v5 | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| Install a specific version: | ||||||||||||
|
|
||||||||||||
| ```yaml | ||||||||||||
| steps: | ||||||||||||
| - name: Setup Kosli CLI | ||||||||||||
| uses: kosli-dev/setup-cli-action@v5 | ||||||||||||
| with: | ||||||||||||
| version: 2.11.43 | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| ## Inputs | ||||||||||||
|
|
||||||||||||
| | Input | Required | Default | Description | | ||||||||||||
| | :--- | :--- | :--- | :--- | | ||||||||||||
| | `version` | No | `latest` | Version of the Kosli CLI to install. See [Version selection](#version-selection). | | ||||||||||||
| | `github-token` | No | `${{ github.token }}` | Token used to authenticate the GitHub API calls that resolve `latest` or a major/minor pin. You normally do not need to set this. | | ||||||||||||
|
|
||||||||||||
| ## Outputs | ||||||||||||
|
|
||||||||||||
| | Output | Description | | ||||||||||||
| | :--- | :--- | | ||||||||||||
| | `version` | The resolved Kosli CLI version that was installed. When `version` is `latest` or a major/minor pin, this is the concrete semver that was selected (e.g. `2.12.0`). | | ||||||||||||
|
|
||||||||||||
| Reference the resolved version in later steps: | ||||||||||||
|
|
||||||||||||
| ```yaml | ||||||||||||
| steps: | ||||||||||||
| - name: Setup Kosli CLI | ||||||||||||
| id: setup | ||||||||||||
| uses: kosli-dev/setup-cli-action@v5 | ||||||||||||
|
|
||||||||||||
| - name: Print installed version | ||||||||||||
| run: echo "Installed Kosli CLI ${{ steps.setup.outputs.version }}" | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| ## Version selection | ||||||||||||
|
|
||||||||||||
| The `version` input accepts: | ||||||||||||
|
|
||||||||||||
| - **A full semver**, e.g. `2.11.43` — installed as-is. | ||||||||||||
| - **A major pin**, e.g. `"2"` — resolves to the newest stable `2.x` release, and never `3.0.0`. | ||||||||||||
| - **A major.minor pin**, e.g. `"2.11"` — resolves to the newest stable `2.11.z` patch. | ||||||||||||
| - **`latest`** — resolves to the newest stable release of [`kosli-dev/cli`](https://github.com/kosli-dev/cli). This is the default. | ||||||||||||
|
|
||||||||||||
| Major and minor pins resolve at runtime and never select a pre-release or a higher major. | ||||||||||||
|
|
||||||||||||
| <Warning> | ||||||||||||
| Quote partial versions. In YAML, `version: 2.10` is parsed as the number `2.1`, which is not what you mean. Always quote a major or minor pin: `version: "2"`, `version: "2.10"`. | ||||||||||||
| </Warning> | ||||||||||||
|
|
||||||||||||
| Track a major version and pick up every update within it without ever jumping to the next (breaking) major: | ||||||||||||
|
|
||||||||||||
| ```yaml | ||||||||||||
| steps: | ||||||||||||
| - name: Setup Kosli CLI | ||||||||||||
| uses: kosli-dev/setup-cli-action@v5 | ||||||||||||
| with: | ||||||||||||
| version: "2" # newest stable 2.x, never 3.x | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| ## Example job | ||||||||||||
|
|
||||||||||||
| Secrets in GitHub Actions are not automatically exported as environment variables, so set the API token explicitly. All CLI flags can be set as environment variables by adding the `KOSLI_` prefix and capitalizing them. | ||||||||||||
|
|
||||||||||||
| ```yaml | ||||||||||||
| jobs: | ||||||||||||
| build-image: | ||||||||||||
| runs-on: ubuntu-latest | ||||||||||||
| env: | ||||||||||||
| KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_TOKEN }} | ||||||||||||
| KOSLI_ORG: my-org | ||||||||||||
| KOSLI_FLOW: my-flow | ||||||||||||
| KOSLI_TRAIL: ${{ github.sha }} | ||||||||||||
| IMAGE_NAME: my-registry/my-image:latest | ||||||||||||
| steps: | ||||||||||||
| - name: Build and push Docker image | ||||||||||||
|
dangrondahl marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Improvement: Missing
Suggested change
|
||||||||||||
| id: build | ||||||||||||
| uses: docker/build-push-action@v5 | ||||||||||||
| with: | ||||||||||||
| push: true | ||||||||||||
| tags: ${{ env.IMAGE_NAME }} | ||||||||||||
|
|
||||||||||||
|
dangrondahl marked this conversation as resolved.
|
||||||||||||
| - name: Setup Kosli CLI | ||||||||||||
| uses: kosli-dev/setup-cli-action@v5 | ||||||||||||
|
|
||||||||||||
| - name: Attest image provenance | ||||||||||||
| run: kosli attest artifact "${IMAGE_NAME}" --artifact-type=oci | ||||||||||||
|
dangrondahl marked this conversation as resolved.
dangrondahl marked this conversation as resolved.
dangrondahl marked this conversation as resolved.
|
||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| For a complete example of a GitHub workflow using Kosli, see the Kosli CLI's [own workflow](https://github.com/kosli-dev/cli/blob/main/.github/workflows/docker.yml). | ||||||||||||
|
|
||||||||||||
| ## References | ||||||||||||
|
|
||||||||||||
| - Action source: [`kosli-dev/setup-cli-action`](https://github.com/kosli-dev/setup-cli-action) | ||||||||||||
| - Marketplace listing: [setup-kosli-cli](https://github.com/marketplace/actions/setup-kosli-cli) | ||||||||||||
| - [CI/CD integration guide](/integrations/ci_cd) | ||||||||||||
| - [Kosli CLI reference](/client_reference) | ||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -34,8 +34,8 @@ description: Use Kosli in CI Systems like GitHub Actions, GitLab CI, and more. | |||||||
|
|
||||||||
| ## Use Kosli in Github Actions | ||||||||
|
|
||||||||
| To use Kosli in [Github Actions](https://docs.github.com/en/actions) workflows, you can use the kosli [CLI setup action](https://github.com/marketplace/actions/setup-kosli-cli) to install the CLI on your Github Actions Runner. | ||||||||
| Then, you can use all the [CLI commands](/client_reference) in your workflows. | ||||||||
| To use Kosli in [Github Actions](https://docs.github.com/en/actions) workflows, you can use the [`setup-kosli-cli` GitHub Action](/github-action-reference/setup_cli_action) to install the CLI on your Github Actions Runner. | ||||||||
| Then, you can use all the [CLI commands](/client_reference) in your workflows. See the GitHub Action reference for its inputs, outputs, and version-pinning options. | ||||||||
|
dangrondahl marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: The second sentence links to the same page already linked in the first sentence. Consider trimming since users will see the inputs/outputs/version-pinning when they follow the first link:
Suggested change
|
||||||||
|
|
||||||||
| ### GitHub Secrets | ||||||||
|
|
||||||||
|
|
||||||||
Uh oh!
There was an error while loading. Please reload this page.