Keep installation instruction simple in installation.md #34
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 Inotify Version | |
on: | |
push: | |
branches: | |
- docs | |
jobs: | |
update_version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Ensure inotify_version file exists | |
run: | | |
if [ ! -f "docs/inotify_version" ]; then | |
touch docs/inotify_version | |
fi | |
- name: Get latest Inotify version | |
id: get_latest_version | |
run: | | |
latest_version=$(curl -s https://api.github.com/repos/inotify-tools/inotify-tools/releases/latest | grep "tag_name" | sed -E 's/.*"([^"]+)".*/\1/') | |
echo "::set-output name=latest_version::$latest_version" | |
- name: Read inotify_version content | |
id: read_inotify_version | |
run: | | |
current_version=$(cat docs/inotify_version) | |
echo "::set-output name=current_version::$current_version" | |
- name: Compare versions | |
id: compare_versions | |
run: | | |
if [ "${{ steps.read_inotify_version.outputs.current_version }}" = "${{ steps.get_latest_version.outputs.latest_version }}" ]; then | |
echo "::set-output name=push_required::false" | |
else | |
echo "::set-output name=push_required::true" | |
fi | |
- name: Commit and push changes | |
if: steps.compare_versions.outputs.push_required == 'true' | |
run: | | |
echo "${{ steps.get_latest_version.outputs.latest_version }}" > docs/inotify_version | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Actions" | |
git add docs/inotify_version | |
git commit -m "Update Inotify version" | |
git push |