-
-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (30 loc) · 978 Bytes
/
version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Update Version
on:
push:
branches:
- main
jobs:
update_version:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get commit count and last commit hash
id: get_info
run: |
COMMIT_COUNT=$(git rev-list --count HEAD)
LAST_COMMIT_HASH=$(git rev-parse HEAD) # Получаем полный хеш
echo "total_commits=$COMMIT_COUNT" >> $GITHUB_ENV
echo "last_commit_hash=$LAST_COMMIT_HASH" >> $GITHUB_ENV
- name: Create VERSION file
run: |
echo "1.7.7_${{ env.last_commit_hash }}" > VERSION
- name: Commit and push changes
run: |
git config user.name "github-actions"
git config user.email "[email protected]"
git add VERSION
git commit -m "Update VERSION file"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}