Skip to content

Commit

Permalink
Add: helm login (#1011)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalholthaus committed Feb 9, 2024
1 parent bdab514 commit e324811
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
33 changes: 33 additions & 0 deletions helm-login/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Helm login and installation

- Helm registry login and optional installation

#### Use Case

```yaml
jobs:
chart:
name: Helm chart push
runs-on: ubuntu-latest
steps:
- ...
- name: Helm login
uses: greenbone/actions/helm-login@v3
- ...
```

## Action Configuration

| Input Variable | Description | |
| ---------------| ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| registry | Registry name. Default: ghcr.io . | Optional |
| registry-user | Registry login user. Default is github.actor . | Optional |
| registry-token | Registry login password/token. Default is github.token . | Optional |
| helm-version | The Helm version for installation must be specified. If left unset, Helm will not be installed. Note that Helm is preinstalled on all GitHub runners. | Optional |
| helm-token | GitHub token required if the Helm version is set to 'latest'. Default is github.token . | Optional |

## Action Output

| Output Variable | Description |
| --------------- | ----------------- |
| helm-path | Helm binary path. |
47 changes: 47 additions & 0 deletions helm-login/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Helm login and installation
description: "Helm registry login and optional installation"

inputs:
registry:
description: "Registry name. Default: ghcr.io ."
default: "ghcr.io"
registry-user:
description: "Registry login user. Default is github.actor ."
default: ${{ github.actor }}
registry-token:
description: "Registry login password/token. Default is github.token ."
default: ${{ github.token }}
helm-version:
description: "The Helm version for installation must be specified. If left unset, Helm will not be installed. Note that Helm is preinstalled on all GitHub runners."
required: false
helm-token:
description: "GitHub token required if the Helm version is set to 'latest'. Default is github.token ."
default: ${{ github.token }}

outputs:
helm-path:
description: 'Helm binary path.'
value: ${{ steps.helm.outputs.helm-path }}

branding:
icon: "package"
color: "green"

runs:
using: "composite"
steps:
- name: Install helm
if: inputs.helm-version
id: helm
uses: azure/setup-helm@v3
with:
version: ${{ inputs.helm-version }}
token: ${{ inputs.helm-token }}

- name: Helm registry login
shell: bash
run: |
helm registry login \
-u '${{ inputs.registry-user }}' \
-p '${{ inputs.registry-token }}' \
'${{ inputs.registry }}'

0 comments on commit e324811

Please sign in to comment.