Check for upstream update #425
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: Check for upstream update | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '1 10 * * *' | |
jobs: | |
get-latest-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Update latest version tag | |
run: | | |
curl -sL https://api.github.com/repos/Steanky/musicbot/releases/latest | \ | |
jq -r ".tag_name" > .upstream_tag_latest | |
- 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 'github-action' | |
git config --global user.email 'enzo@aguado.me' | |
git add .upstream_tag_latest | |
git commit -m "Update to version $(cat .upstream_tag_latest)" | |
git push origin master |