Skip to content

Create nightly_flutter_version.yml #2

Create nightly_flutter_version.yml

Create nightly_flutter_version.yml #2

name: Check Flutter Version
# on:
# schedule:
# - cron: "0 0 * * *"
on:
pull_request:
branches:
- master
jobs:
check-flutter-version:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Get latest stable Flutter version
id: flutter-version
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Get latest tag
id: latest-tag
run: echo "tag=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_OUTPUT
- name: Compare versions
id: compare-versions
run: echo "is-lower=$(python -c "import re; from distutils.version import LooseVersion; print(LooseVersion(re.search(r'\d+\.\d+\.\d+', '${{ steps.flutter-version.outputs.flutter-version }}').group(0)) > LooseVersion('${{ steps.latest-tag.outputs.tag }}'))")" >> $GITHUB_OUTPUT
- name: Create pull request if necessary
if: ${{ steps.compare-versions.outputs.is-lower == 'True' }}
run: echo current flutter version is higher