Merge remote-tracking branch 'origin/master' #9
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: Update Version | |
on: | |
push: | |
branches: | |
- master # 监听主分支代码提交事件 | |
jobs: | |
update-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Update version | |
run: | | |
# 读取当前版本号 | |
current_version=$(cat VERSION) | |
# 将版本号加1 | |
new_version=$((current_version + 1)) | |
# 更新版本号到文件 | |
echo $new_version > VERSION | |
- name: Commit changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git commit -m "Update version" -a | |
git push origin master |