mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-05 16:16:21 -03:00
add renovate bump scripting
This commit is contained in:
67
.github/workflows/renovate-bump.yaml
vendored
Normal file
67
.github/workflows/renovate-bump.yaml
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
name: "Renovate: Bump on Push"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'renovate/**'
|
||||
tags-ignore:
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
renovate-bump:
|
||||
name: Get changed Apps
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3
|
||||
name: Checkout
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.BOT_TOKEN }}
|
||||
- uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3
|
||||
name: Checkout
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: main
|
||||
path: main
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
list-files: json
|
||||
filters: |
|
||||
changed:
|
||||
- 'charts/**'
|
||||
- name: Filter filter-output
|
||||
run: echo '${{ toJson(steps.filter.outputs) }}' > changes.json
|
||||
- name: Bump
|
||||
run: |
|
||||
APPS=$(jq --raw-output '.changed_files | fromjson | .[] |= sub("(?<filepath>(?<first_directory>(?<root1>[\/]?)[^\/]+\/)(?<second_directory>(?<root2>[\/]?)[^\/]+\/)(?<extra_paths>.+))"; "\(.second_directory)") | unique' changes.json | jq -r '.[]')
|
||||
echo "changed apps: ${APPS[*]}"
|
||||
for chart in ${APPS[*]}
|
||||
do
|
||||
if [[ "${chart}" == '.gitkee' ]]; then
|
||||
echo "Skipping..."
|
||||
return
|
||||
fi
|
||||
echo "Comparing versions for ${chart}"
|
||||
master=$(cat ./master/charts/${chart}/Chart.yaml | grep "^version")
|
||||
current=$(cat ./charts/${chart}/Chart.yaml | grep "^version")
|
||||
echo "master version: ${master}"
|
||||
echo "current version: ${current}"
|
||||
if [[ "${master}" != "${current}" ]]; then
|
||||
echo "Version does not have to be bumped"
|
||||
else
|
||||
echo "Bumping patch version for ${chart}"
|
||||
./tools/bump.sh patch ./charts/${chart}
|
||||
fi
|
||||
done
|
||||
- name: Cleanup
|
||||
run: |
|
||||
rm -rf changes.json
|
||||
rm -rf master
|
||||
- name: Commit and Push new version
|
||||
run: |
|
||||
git config user.name "TrueCharts-Bot"
|
||||
git config user.email "bot@truecharts.org"
|
||||
git add --all
|
||||
git commit -sm "Commit bumped App Version" || exit 0
|
||||
git push
|
||||
Reference in New Issue
Block a user