From 7f4bc1fb54e3dbd1ffb76a6490c846fcc8317657 Mon Sep 17 00:00:00 2001 From: Meliox Date: Mon, 15 Sep 2025 21:42:13 +0200 Subject: [PATCH] first --- .github/workflows/update-version.yml | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/update-version.yml diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml new file mode 100644 index 0000000..be42d82 --- /dev/null +++ b/.github/workflows/update-version.yml @@ -0,0 +1,31 @@ +jobs: + update-versions: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Get commit hash + id: vars + run: echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Find changed scripts + id: changed + run: | + CHANGED=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '.*\.sh$' || true) + echo "changed_scripts=$CHANGED" >> $GITHUB_OUTPUT + + - name: Update versions + run: | + for f in ${{ steps.changed.outputs.changed_scripts }}; do + sed -i "s/^VERSION=\".*\"/VERSION=\"${{ steps.vars.outputs.hash }}\"/" "$f" + done + + - name: Commit updated scripts + if: ${{ steps.changed.outputs.changed_scripts != '' }} + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add ${{ steps.changed.outputs.changed_scripts }} + git commit -m "chore: bump versions of changed scripts [skip ci]" + git push