Get latest release version #183
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: Get latest release version | |
on: | |
schedule: | |
- cron: '0 10 * * *' | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
jobs: | |
get-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.REPO_SCOPED_TOKEN }} | |
- name: Fetch release version | |
run: | | |
curl -sL https://api.github.com/repos/anuken/mindustry/releases/latest | \ | |
jq -r ".tag_name" > server-release-versions | |
- name: Check for modified files | |
id: git-check | |
run: echo ::set-output name=modified::$([ -z "`git status --porcelain`" ] && echo "false" || echo "true") | |
- name: Commit latest release version | |
if: steps.git-check.outputs.modified == 'true' | |
run: | | |
git config --global user.name 'Richard Wang' | |
git config --global user.email '[email protected]' | |
git commit -am "New release version" | |
git push |