Skip to content

Commit

Permalink
feat(login): expose JFrog domain as jfrog-login output (#43)
Browse files Browse the repository at this point in the history
* feat(login): expose JFrog domain as `jfrog-login` output

* feat(login): expose `jfrog-login` outputs as environement variables
  • Loading branch information
noirbizarre authored Sep 16, 2024
1 parent 110b187 commit 359bb12
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
12 changes: 11 additions & 1 deletion actions/jfrog-login/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,23 @@ jobs:
| `oidc-token` | <p>OIDC token generated by JFrog CLI for secure API/CLI interactions, using the Setup JFrog CLI step with the configured oidc-provider-name.</p> |
| `oidc-user` | <p>Username extracted from the OIDC token during authentication.</p> |
| `jfrog-url` | <p>Base URL of Ledger's JFrog platform to be used for subsequent API/CLI operations.</p> |
| `jfrog-domain` | <p>Base domain of Ledger's JFrog platform to be used for subsequent API/CLI operations.</p> |
<!-- action-docs-outputs source="action.yml" -->

Those are also exposed as environment variables:

| name | description |
| --- | --- |
| `JFROG_TOKEN` | <p>OIDC token generated by JFrog CLI for secure API/CLI interactions, using the Setup JFrog CLI step with the configured oidc-provider-name.</p> |
| `JFROG_USER` | <p>Username extracted from the OIDC token during authentication.</p> |
| `JFROG_URL` | <p>Base URL of Ledger's JFrog platform to be used for subsequent API/CLI operations.</p> |
| `JFROG_DOMAIN` | <p>Base domain of Ledger's JFrog platform to be used for subsequent API/CLI operations.</p> |

## Runs

This action is a **composite action**, which allows us to combine multiple workflow steps into a single, reusable action. This promotes modularity and simplifies our workflows.

## Additional Information

- This action securely manages the OIDC-based login for Ledger's JFrog platform, removing the need for manual credential handling.
- Ensure your GitHub repository and workflows are configured to use OIDC for maximum security and efficiency.
- Ensure your GitHub repository and workflows are configured to use OIDC for maximum security and efficiency.
15 changes: 14 additions & 1 deletion actions/jfrog-login/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ outputs:
jfrog-url:
description: "Base URL of Ledger's JFrog platform to be used for subsequent API/CLI operations."
value: "https://jfrog.ledgerlabs.net"
jfrog-domain:
description: "Base domain of Ledger's JFrog platform to be used for subsequent API/CLI operations."
value: "jfrog.ledgerlabs.net"

runs:
using: "composite"
Expand All @@ -25,4 +28,14 @@ runs:
JF_URL: "https://jfrog.ledgerlabs.net"
with:
oidc-provider-name: github-oidc
oidc-audience: jfrog-github
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

0 comments on commit 359bb12

Please sign in to comment.