Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 62afe29

Browse files
committed
🎉 Initial commit
0 parents  commit 62afe29

File tree

5 files changed

+100
-0
lines changed

5 files changed

+100
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @gabe565

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea/

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Setup Helm Docs Action
2+
This action installs [norwoodj/helm-docs](https://github.com/norwoodj/helm-docs).
3+
4+
# Usage
5+
6+
## Inputs
7+
| Name | Description | Required | Default |
8+
|-----------|----------------------------------|----------|-----------------------|
9+
| `version` | The Helm Docs version to install | `false` | `latest` |
10+
| `token` | GitHub token | `false` | `${{ github.token }}` |
11+
12+
## Outputs
13+
| Name | Description |
14+
|-----------|------------------------------------------|
15+
| `version` | The Helm Docs version that was installed |
16+
17+
## Example Workflow
18+
```yaml
19+
name: Update Chart Metadata
20+
21+
on: push
22+
23+
jobs:
24+
update-chart-metadata:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: gabe565/setup-helm-docs-action@v1
29+
- run: helm-docs
30+
```

action.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Setup Helm Docs
2+
description: GitHub Action to install Helm Docs during CI/CD.
3+
inputs:
4+
token:
5+
description: GitHub token
6+
default: ${{ github.token }}
7+
version:
8+
description: The Helm Docs version to install
9+
default: latest
10+
outputs:
11+
version:
12+
description: The Helm Docs version that was installed
13+
value: ${{ steps.version.install.version }}
14+
runs:
15+
using: composite
16+
steps:
17+
- id: install
18+
name: Install helm-docs
19+
shell: bash
20+
env:
21+
GH_TOKEN: ${{ inputs.token }}
22+
VERSION: ${{ inputs.version }}
23+
run: |
24+
set -euo pipefail
25+
26+
if [[ "$VERSION" == latest ]]; then
27+
VERSION=
28+
fi
29+
30+
case "${{ runner.os }}" in
31+
Linux)
32+
OS=linux
33+
FILENAME=helm-docs
34+
;;
35+
macOS)
36+
OS=darwin
37+
FILENAME=helm-docs
38+
;;
39+
Windows)
40+
OS=windows
41+
FILENAME=helm-docs.exe
42+
;;
43+
esac
44+
45+
RELEASE="$(gh release view --repo=norwoodj/helm-docs --json=name,assets $VERSION)"
46+
VERSION="$(jq -r '.name' <<<"$RELEASE")"
47+
echo "version=$VERSION" >>$GITHUB_OUTPUT
48+
echo "Installing helm-docs $VERSION..."
49+
50+
DEST="$RUNNER_TEMP/helm-docs"
51+
URL="$(jq -r --arg OS "$OS" \
52+
'.assets[] | select(.name | ascii_downcase | test($OS + "_(amd64|x86_64).(tar.gz|zip)$")) | .url' \
53+
<<<"$RELEASE" \
54+
)"
55+
56+
echo "Downloading $URL"
57+
mkdir -p "$DEST"
58+
if [[ "$URL" == *.tar.gz ]]; then
59+
curl -sfL "$URL" \
60+
| tar -xzf - -C "$DEST" "$FILENAME"
61+
fi
62+
echo "$DEST" >>$GITHUB_PATH

renovate.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"local>gabe565/renovate-config"
5+
]
6+
}

0 commit comments

Comments
 (0)