From ac7d0396a495241fc831a93afd8b76ae19645c15 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20=22=27=20OR=201=3D=3D1=3B=20--=20=23=20Ib=C3=A1?=
 =?UTF-8?q?=C3=B1ez?= <carlos.ibanez@tii.ae>
Date: Wed, 3 Apr 2024 10:55:49 +0400
Subject: [PATCH] Add Github workflow to autocreate VERSION files on main and
 develop

---
 .github/workflows/version.yaml | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 .github/workflows/version.yaml

diff --git a/.github/workflows/version.yaml b/.github/workflows/version.yaml
new file mode 100644
index 00000000..2f613d4c
--- /dev/null
+++ b/.github/workflows/version.yaml
@@ -0,0 +1,31 @@
+name: Version File
+on:
+  push:
+    branches:
+      - main
+      - develop
+jobs:
+  version-file:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
+    steps:
+      - name: Checkout Code
+        uses: actions/checkout@v4
+        with:
+          ref: ${{ github.head_ref }}
+          fetch-depth: 0
+      - name: Create VERSION file
+        run: |
+          {
+            echo GIT_SHA=$GITHUB_SHA
+            echo EPOCH_TIMESTAMP=$(date +%s)
+            echo PRECISE_DATE_TIMESTAMP=\"$(date "+%Y-%m-%d - %H:%M:%S.%N")\"
+          } > VERSION
+      - name: Commit changes
+        uses: stefanzweifel/git-auto-commit-action@v5
+        with:
+          commit_message: 'Update VERSION'
+          disable_globbing: true
+          file_pattern: VERSION
\ No newline at end of file