Skip to content

Check for upstream update #415

Check for upstream update

Check for upstream update #415

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