2024-07-22 20:22:43 +00:00
|
|
|
<!--
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2023-present Sonatype, Inc. All rights reserved.
|
|
|
|
|
Includes the third-party code listed at https://links.sonatype.com/products/clm/attributions.
|
|
|
|
|
"Sonatype" is a trademark of Sonatype, Inc.
|
|
|
|
|
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
# Sonatype CLI Setup Action
|
|
|
|
|
|
|
|
|
|
A [GitHub Action](https://github.com/features/actions) for setting up
|
|
|
|
|
[Sonatype CLI](https://help.sonatype.com/en/sonatype-iq-cli.html) as a tool that is available for GitHub runners and
|
|
|
|
|
subsequent actions. The action downloads and configures the requested version of the Sonatype CLI.
|
|
|
|
|
|
|
|
|
|
## Usage Example
|
|
|
|
|
|
2024-07-24 16:10:36 +00:00
|
|
|
Here's an example of how the setup action can be used in your code. Note that this is a prerequisite for the
|
|
|
|
|
[Run Sonatype CLI](../run-iq-cli/README.md) action provided in this action set.
|
|
|
|
|
|
2024-07-22 20:22:43 +00:00
|
|
|
```yaml
|
|
|
|
|
name: Sonatype Workflow
|
|
|
|
|
on: push
|
|
|
|
|
jobs:
|
|
|
|
|
sonatype-cli:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
|
|
|
|
- name: Setup Sonatype CLI
|
|
|
|
|
uses: sonatype/actions/setup-iq-cli@v1
|
|
|
|
|
with:
|
|
|
|
|
iq-cli-version: 1.179.0-01
|
|
|
|
|
```
|
|
|
|
|
|
2026-02-10 19:58:01 +00:00
|
|
|
Alternatively, instead of providing `iq-cli-version`, you can provide the `iq-cli-download-url` parameter and optionally
|
|
|
|
|
access credentials via the `iq-cli-download-auth` parameter. In this case, the Sonatype CLI JAR file will be downloaded
|
|
|
|
|
from the specified location URL.
|
2024-10-10 19:52:22 +00:00
|
|
|
|
2024-07-22 20:22:43 +00:00
|
|
|
## Parameters
|
|
|
|
|
|
|
|
|
|
> **iq-cli-version**\
|
|
|
|
|
> Sonatype CLI version to be used. It could be a full version (e.g. 1.179.0-01), a short version (e.g. 179) or `latest`.
|
2024-11-21 18:26:55 +00:00
|
|
|
> Either this or `iq-cli-download-url` is required.
|
2024-10-10 19:52:22 +00:00
|
|
|
|
|
|
|
|
> **iq-cli-download-url**\
|
2024-11-21 18:26:55 +00:00
|
|
|
> URL from where the IQ CLI jar file will be downloaded. Either this or `iq-cli-version` is required.
|
2024-08-15 20:02:44 +00:00
|
|
|
|
2026-02-10 19:58:01 +00:00
|
|
|
> **iq-cli-download-auth**\
|
|
|
|
|
> Credentials for accessing the IQ CLI download URL. Format: `username:password`. Basic authentication is used.
|
|
|
|
|
|
2024-08-15 20:02:44 +00:00
|
|
|
## Output
|
|
|
|
|
|
|
|
|
|
> **iq-cli-version**\
|
|
|
|
|
> Semver valid version of the IQ CLI configured. It can be used as an input parameter for run-iq-cli.
|