Skip to content

Download Helm Chart #68

Download Helm Chart

Download Helm Chart #68

name: Download Helm Chart
on:
workflow_dispatch:
inputs:
repo:
type: string
required: true
description: 'The target repo name to fetch released chart packages. e.g. ("open-cluster-management-io/registration")'
version:
type: string
required: true
description: 'The target release to download the chart package, should be a valid semver. e.g. ("1.1.1")'
chart-name:
type: string
required: true
description: 'The chart package name which is used for finding the target asset. The downloading asset name will be "<chart-name>-<version>.tgz"'
env:
# Common versions
PUBLISH_BRANCH: 'main'
jobs:
download:
runs-on: ubuntu-latest
steps:
- name: Turnstyle
uses: softprops/turnstyle@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ env.PUBLISH_BRANCH }}
token: ${{ secrets.OCM_BOT_PAT }}
- uses: robinraju/[email protected]
with:
repository: "${{ github.event.inputs.repo }}"
tag: "v${{ github.event.inputs.version }}"
fileName: "${{ github.event.inputs.chart-name }}-${{ github.event.inputs.version }}.tgz"
out-file-path: "charts/"
token: ${{ secrets.OCM_BOT_PAT }}
- name: Push Chart
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
git add .
git status
git commit -s \
-m "Automated upload ${{ github.event.inputs.repo }} ${{ github.event.inputs.chart-name }}-${{ github.event.inputs.version }}.tgz"
git push https://${{ github.token }}@github.com/${{ github.repository }}.git ${{ env.PUBLISH_BRANCH }}