Skip to content
This repository was archived by the owner on May 11, 2026. It is now read-only.

Commit 510e4f4

Browse files
committed
finish appVersion update
1 parent 5d7c3c7 commit 510e4f4

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

.github/workflows/update-app-version.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,32 @@ jobs:
2020
id: variables
2121
envs:
2222
DIR: charts/${{ github.event.inputs.chart }}
23+
valid: '0-9a-zA-Z\-\_'
2324
run: |
2425
if [ ! -d "$DIR" ]; then
2526
echo "Chart ${{ github.event.inputs.chart }} does not exist. Canceling update..."
2627
exit 1
2728
else
28-
echo "Chart ${{ github.event.inputs.chart }} found. Update appVersion to ${{ github.event.inputs.version }}"
29+
if [[ ! "${{ github.event.inputs.version }}" =~ [^$valid] ]]; then
30+
echo "appVersion does not match regex ${{ github.event.inputs.version }}, canceling update..."
31+
exit 1
32+
else
33+
echo "Chart ${{ github.event.inputs.chart }} found. Update appVersion to ${{ github.event.inputs.version }}"
34+
fi
2935
fi
3036
3137
update_appVersion:
3238
runs-on: [ubuntu-latest]
3339
steps:
34-
- name: Get Instance(s)
40+
- name: Checkout code
41+
uses: actions/checkout@v2
42+
- name: Set appVersion and push
3543
run: |
36-
echo "Hallo Welt"
44+
sed -i "s/appVersion: .*/appVersion: ${{ github.event.inputs.version }}/g" charts/${{ github.event.inputs.chart }}/Chart.yaml
3745
46+
git config user.name "$GITHUB_ACTOR"
47+
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
48+
49+
git status
50+
git commit -a -m "update chart ${{ github.event.inputs.chart }} to appVersion ${{ github.event.inputs.version }}"
51+
git push

0 commit comments

Comments
 (0)