-
Notifications
You must be signed in to change notification settings - Fork 2
34 lines (30 loc) · 1.31 KB
/
update-helm-block.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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 }}