Skip to content

Commit

Permalink
[CHORE] adding workflow to update helm on new tag (#57)
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Takashi <nicolas.takashi@coralogix.com>
  • Loading branch information
nicolastakashi authored Aug 23, 2023
1 parent 9ad7c19 commit d6e8d51
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/helm-update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: update chart version and open pr
on:
create:
tags:
- "v*"

jobs:
update-chart-version:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Git
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Update Chart Version
run: |
TAG=$(echo "${{ github.event.ref }}" | sed -n 's/refs\/tags\/v\(.*\)/\1/p')
CURRENT_VERSION=$(grep "version:" charts/coralogix-operator/Chart.yaml | awk '{print $2}')
NEW_VERSION=$(echo $CURRENT_VERSION | awk -F. -v OFS=. '{$3+=1}1')
git checkout -b update-chart-version-${TAG}
sed -i "s/appVersion:.*/appVersion: $TAG/" charts/coralogix-operator/Chart.yaml
sed -i "s/version:.*/version: $NEW_VERSION/" charts/coralogix-operator/Chart.yaml
git add charts/coralogix-operator/Chart.yaml
git commit -m "Bump version and update appVersion in Chart.yaml"
git push origin update-chart-version-${TAG}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Bump version and update appVersion in Chart.yaml"
title: "Bump version and update appVersion in Chart.yaml"
branch: update-chart-version-${TAG}
body: |
This pull request bumps the version and updates the appVersion in Chart.yaml to match the tag.

0 comments on commit d6e8d51

Please sign in to comment.