Publish Helm Charts for version 4.3.6 (#135) #153
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update repository's main README file | |
on: | |
push: | |
branches: [main] | |
jobs: | |
README_UPDATE: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Updating README | |
run: | | |
SHELL=/bin/bash | |
LATEST_VERSION="$(ls | grep -E '^[0-9]+(\.[0-9]+)*$' | sort --version-sort | tail -n 1)" | |
echo "LATEST VERSION is $LATEST_VERSION" | |
sed -i.bak -E 's@(Latest version: |Latest%20version-|\[Latest version\]: \./)[0-9]+(\.[0-9]+)*@\1'"$LATEST_VERSION"'@g' README.md | |
rm -f "README.md.bak" 2>/dev/null || true | |
rm -f latest 2>/dev/null || true | |
ln -s "./${LATEST_VERSION}/" latest | |
git add latest | |
if git diff --quiet HEAD; then | |
echo "No updates." | |
# Keep master in sync with main | |
git push origin HEAD:master | |
else | |
echo "Updated README and latest symlink" | |
git config --global user.name 'roxbot' | |
git config --global user.email '[email protected]' | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/"$GITHUB_REPOSITORY" | |
msg="Updated latest version reference to ${LATEST_VERSION}" | |
if grep -q "$msg" < <(git log -n 1 --pretty='format:%s'); then | |
echo "Latest version update already exists, but still changes detected!" | |
git diff HEAD | |
exit 1 | |
fi | |
git commit -am "$msg 🤖" | |
git push origin HEAD:main | |
# Keep master in sync with main | |
git push origin HEAD:master | |
fi | |
echo "✓ Done" |