Skip to content

chart-update

chart-update #125

name: Update Helm Block
on:
repository_dispatch:
types: [chart-update]
jobs:
update-helm-block:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create new branch
id: branch
run: |
echo ${{ github.event.client_payload.chart }}
BRANCH_NAME="${{ github.event.client_payload.chart }}-version-up-to-${{ github.event.client_payload.version }}"
git checkout -b $BRANCH_NAME
echo "branch_name=$BRANCH_NAME" >> "$GITHUB_OUTPUT"
- name: Update helm block
run: |
CHART=${{ github.event.client_payload.chart }}
VERSION=${{ github.event.client_payload.version }}
sed -i "s/\(${CHART}-version =\) .*/\1 \"${VERSION}\"/" helm.tf
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add helm.tf
git commit -m "⚡️ :: Update ${CHART} version to ${VERSION}"
git push origin ${{ steps.branch.outputs.branch_name }}
gh pr create --title "🔀 :: Update ${CHART} version to ${VERSION}" --body "Update helm chart version" --base main --head ${{ steps.branch.outputs.branch_name }}
env:
GH_TOKEN: ${{ secrets.GHP_TOKEN }}