-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Convert Nexus IQ reusable workflow to an action
Signed-off-by: Matthew Watkins <[email protected]>
- Loading branch information
1 parent
2a4fa0c
commit 812a1cf
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-FileCopyrightText: 2024 The Linux Foundation | ||
|
||
# Runs a Sonatype Lifecycle (Nexus IQ) scan | ||
name: "Sonatype Lifecycle Action" | ||
|
||
inputs: | ||
JAVA_DISTRIBUTION: | ||
description: "JAVA SE distribution to setup/run for Nexus CLI tool" | ||
required: false | ||
type: string | ||
default: "temurin" | ||
JAVA_VERSION: | ||
description: "Java runtime to setup/run for Nexus CLI tool" | ||
required: false | ||
type: number | ||
default: 17 | ||
IQ_CLI_VERSION: | ||
description: "Specific version of Nexus CLI to setup/run" | ||
required: false | ||
type: string | ||
default: "1.179.0-01" | ||
APPLICATION_ID: | ||
description: "Organisation and project name in Nexus IQ" | ||
required: false | ||
type: string | ||
default: ${{ github.repository_owner }}-${{ github.event.repository.name }} | ||
SCAN_TARGETS: | ||
description: "Location of file(s) or folder(s) to scan" | ||
required: false | ||
type: string | ||
default: "." | ||
NEXUS_IQ_PASSWORD: | ||
description: "Nexus IQ Password" | ||
required: true | ||
|
||
steps: | ||
- name: Setup Sonatype CLI | ||
uses: sonatype/actions/setup-iq-cli@v1 | ||
with: | ||
iq-cli-version: ${{ inputs.IQ_CLI_VERSION }} | ||
|
||
# Sonatype CLI requires Java to run | ||
- name: Setup Java runtime | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ inputs.JAVA_DISTRIBUTION }} | ||
java-version: ${{ inputs.JAVA_VERSION }} | ||
|
||
- name: Run Sonatype CLI | ||
uses: sonatype/actions/run-iq-cli@v1 | ||
with: | ||
iq-server-url: ${{ vars.NEXUS_IQ_SERVER }} | ||
username: ${{ vars.NEXUS_IQ_USERNAME }} | ||
password: ${{ secrets.NEXUS_IQ_PASSWORD }} | ||
application-id: ${{ inputs.APPLICATION_ID }} | ||
scan-targets: ${{ inputs.SCAN_TARGETS }} |