Skip to content

Commit

Permalink
perf: add autocheack
Browse files Browse the repository at this point in the history
  • Loading branch information
wojiushixiaobai committed Oct 18, 2024
1 parent 3063508 commit ff8977e
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/check-latest-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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 add .
git commit -m "Update Version to ${{ env.version }}"
git push origin HEAD

0 comments on commit ff8977e

Please sign in to comment.