ci: Auto-update Elastic version on tls branch
This commit is contained in:
parent
94d6273524
commit
f808ff31cf
|
@ -7,13 +7,14 @@ on:
|
|||
- completed
|
||||
branches:
|
||||
- update/main
|
||||
- update/tls
|
||||
- update/release-7.x
|
||||
|
||||
jobs:
|
||||
|
||||
merge:
|
||||
name: Merge pull request
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
if: github.event.workflow_run.conclusion == 'success'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
|
|
@ -11,12 +11,11 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
release:
|
||||
- 8.x
|
||||
- 7.x
|
||||
include:
|
||||
- release: 8.x
|
||||
branch: main
|
||||
- release: 8.x
|
||||
branch: tls
|
||||
- release: 7.x
|
||||
branch: release-7.x
|
||||
|
||||
|
@ -68,12 +67,15 @@ jobs:
|
|||
cur_ver="$ELASTIC_VERSION"
|
||||
new_ver=${{ fromJson(steps.get-latest-release.outputs.result).version }}
|
||||
|
||||
# Escape dot characters so sed interprets them as literal dots
|
||||
cur_ver="$(echo $cur_ver | sed 's/\./\\./g')"
|
||||
# Escape period characters so sed interprets them literally
|
||||
cur_ver="${cur_ver//./\\.}"
|
||||
|
||||
for f in .env README.md; do
|
||||
sed -i "s/${cur_ver}/${new_ver}/g" "$f"
|
||||
done
|
||||
declare -a upd_files=( .env README.md )
|
||||
if [ -f tls/README.md ]; then
|
||||
upd_files+=( tls/README.md )
|
||||
fi
|
||||
|
||||
sed -i "s/${cur_ver}/${new_ver}/g" "${upd_files[@]}"
|
||||
|
||||
git_status="$(git status --porcelain)"
|
||||
if [[ ${git_status} ]]; then
|
||||
|
|
Loading…
Reference in New Issue