Merge branch 'main' of https://github.com/community-scripts/ProxmoxVED
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled

This commit is contained in:
CanbiZ 2025-09-18 13:07:14 +02:00
commit af1522ce82

44
.github/workflows/revision-bump.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: Bump build.func Revision
on:
push:
branches: [ main ]
paths:
- 'misc/*.func'
- 'misc/*.sh'
jobs:
bump-revision:
runs-on: ubuntu-latest
if: github.event.head_commit.author.name != 'github-actions[bot]'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Detect misc changes
id: changes
run: |
git diff --name-only HEAD^ HEAD > changed_files.txt
echo "changed=$(cat changed_files.txt)" >> $GITHUB_OUTPUT
- name: Bump Revision if needed
if: contains(steps.changes.outputs.changed, 'misc/') && !contains(steps.changes.outputs.changed, 'misc/build.func')
run: |
REV_FILE=".build-revision"
if [ ! -f "$REV_FILE" ]; then echo 0 > "$REV_FILE"; fi
REV_NUM=$(($(cat $REV_FILE) + 1))
echo $REV_NUM > $REV_FILE
SHORT_SHA=$(git rev-parse --short HEAD)
REV_STR="Revision: r${REV_NUM} (git-${SHORT_SHA})"
sed -i "s/^# Revision:.*/# $REV_STR/" misc/build.func
echo "REV_STR=$REV_STR" >> $GITHUB_ENV
- name: Commit & push revision
if: contains(steps.changes.outputs.changed, 'misc/') && !contains(steps.changes.outputs.changed, 'misc/build.func')
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add misc/build.func .build-revision
git commit -m "chore: bump build.func to $REV_STR"
git push