Check Release #26
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 Release | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 20 * * *' | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: v4.0 | |
- name: Get Version | |
run: | | |
version=$(curl -s https://api.github.com/repos/jumpserver/jumpserver/releases/latest | jq -r .tag_name) | |
echo "Current Version: ${version}" | |
if [ -z "${version}" ]; then | |
exit 1 | |
fi | |
echo "version=${version}" >> $GITHUB_ENV | |
grep -q "tag: v${version}" mkdocs.yml || echo "update=true" >> $GITHUB_ENV | |
- name: Update Version | |
if: env.update == 'true' | |
run: | | |
sed -i "s@tag: v.*@tag: ${{ env.version }}@" mkdocs.yml | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add . | |
git commit -m "Update Version to ${{ env.version }}" | |
git push origin HEAD |