Skip to content

Commit

Permalink
feat(jfrog-login): add jfrog orange oidc (#53)
Browse files Browse the repository at this point in the history
* feat(jfrog-login): add jfrog orange oidc

* feat(jfrog-login): rename input jfrog-url

* feat(jfrog-login): change way for output domain
  • Loading branch information
xchalle authored Dec 17, 2024
1 parent 337f385 commit 456d2a1
Showing 1 changed file with 27 additions and 20 deletions.
47 changes: 27 additions & 20 deletions actions/jfrog-login/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ name: "[Ledger Security] JFrog Login"
author: LedgerHQ
description: |
The `jfrog-login` GitHub Action facilitates a secure login to Ledger's JFrog platform, which includes services such as **Artifactory** and **Xray**. By using OIDC authentication, this action ensures secure access to manage artifacts, perform security scans, and interact with the JFrog APIs and CLI without handling sensitive credentials manually.
This action is designed for seamless integration within Ledger's CI/CD pipeline, allowing developers to securely interact with JFrog services while automating critical parts of the software supply chain.
inputs:
jfrog-url:
description: "Base URL of the JFrog platform to be used for API/CLI operations. Defaults to Ledger's JFrog URL if not specified."
required: false
default: "https://jfrog.ledgerlabs.net"

outputs:
oidc-token:
description: "OIDC token generated by JFrog CLI for secure API/CLI interactions, using the Setup JFrog CLI step with the configured oidc-provider-name."
Expand All @@ -14,28 +20,29 @@ outputs:
value: ${{ steps.setup-jfrog-cli.outputs.oidc-user }}
jfrog-url:
description: "Base URL of Ledger's JFrog platform to be used for subsequent API/CLI operations."
value: "https://jfrog.ledgerlabs.net"
value: ${{ inputs.jf_url }}
jfrog-domain:
description: "Base domain of Ledger's JFrog platform to be used for subsequent API/CLI operations."
value: "jfrog.ledgerlabs.net"
value: ${{steps.expose-outputs.outputs.jfrog-domain }}

runs:
using: "composite"
steps:
- uses: jfrog/setup-jfrog-cli@v4
id: setup-jfrog-cli
env:
JF_URL: "https://jfrog.ledgerlabs.net"
with:
oidc-provider-name: github-oidc
oidc-audience: jfrog-github
- name: Expose outputs as environment variables
run: |
: Expose outputs as environment variables
echo "JFROG_USER=${{ steps.setup-jfrog-cli.outputs.oidc-user }}" >> $GITHUB_ENV
echo "JFROG_TOKEN=${{ steps.setup-jfrog-cli.outputs.oidc-token }}" >> $GITHUB_ENV
echo "JFROG_DOMAIN=${JFROG_DOMAIN}" >> $GITHUB_ENV
echo "JFROG_URL=https://${JFROG_DOMAIN}" >> $GITHUB_ENV
env:
JFROG_DOMAIN: jfrog.ledgerlabs.net
shell: bash
- uses: jfrog/setup-jfrog-cli@v4
id: setup-jfrog-cli
env:
JF_URL: ${{ inputs.jfrog-url }}
with:
oidc-provider-name: github-oidc
oidc-audience: jfrog-github
- name: Expose outputs as environment variables
id: expose-outputs
run: |
: Expose outputs as environment variables
JFROG_DOMAIN=$(echo "${{ inputs.jfrog-url }}" | awk -F[/:] '{print $4}')
echo "JFROG_DOMAIN=$JFROG_DOMAIN" >> $GITHUB_ENV
echo "JFROG_DOMAIN=$JFROG_DOMAIN" >> $GITHUB_OUTPUT
echo "JFROG_USER=${{ steps.setup-jfrog-cli.outputs.oidc-user }}" >> $GITHUB_ENV
echo "JFROG_TOKEN=${{ steps.setup-jfrog-cli.outputs.oidc-token }}" >> $GITHUB_ENV
echo "JFROG_URL=${{ inputs.jfrog-url }}" >> $GITHUB_ENV
shell: bash

0 comments on commit 456d2a1

Please sign in to comment.