Skip to content

Commit

Permalink
ci: Auto-update Elastic version on tls branch
Browse files Browse the repository at this point in the history
  • Loading branch information
antoineco committed May 29, 2022
1 parent 94d6273 commit f808ff3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/update-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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//./\\.}"
declare -a upd_files=( .env README.md )
if [ -f tls/README.md ]; then
upd_files+=( tls/README.md )
fi
for f in .env README.md; do
sed -i "s/${cur_ver}/${new_ver}/g" "$f"
done
sed -i "s/${cur_ver}/${new_ver}/g" "${upd_files[@]}"
git_status="$(git status --porcelain)"
if [[ ${git_status} ]]; then
Expand Down

0 comments on commit f808ff3

Please sign in to comment.