From a03ca0a2165741fc1ae23dc8b2bce138d84bc0ca Mon Sep 17 00:00:00 2001 From: Jochem Date: Fri, 5 Jul 2024 14:49:15 +0200 Subject: [PATCH] Add set appversion workflow --- .github/workflows/set-appVersion.yml | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/set-appVersion.yml diff --git a/.github/workflows/set-appVersion.yml b/.github/workflows/set-appVersion.yml new file mode 100644 index 0000000..2b10ec1 --- /dev/null +++ b/.github/workflows/set-appVersion.yml @@ -0,0 +1,34 @@ +name: Updste LibreNMS appVersion +on: + push: + branches: + - renovate/* + +jobs: + set-appverions: + runs-on: ubuntu-24.04 + + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + + + - name: Find image version + run: | + wget https://github.com/mikefarah/yq/releases/download/v4.44.2/yq_linux_amd64.tar.gz -O /tmp/yq.tgz + tar -xvf /tmp/yq.tgz --directory /tmp + chmod +x /tmp/yq_linux_amd64 + + export VERSION=$(/tmp/yq_linux_amd64 '.librenms.image.tag' charts/librenms/values.yaml) + echo "DETECTED VERSION $VERSION" + /tmp/yq_linux_amd64 -e -i '.appVersion = env(VERSION)' charts/librenms/Chart.yaml + + + # Commit all changed files back to the repository + - uses: stefanzweifel/git-auto-commit-action@v5 \ No newline at end of file