added auto detect branch name and version tag

This commit is contained in:
Anirban Kar
2024-12-16 01:54:24 +05:30
parent c4f94aa517
commit 885e104f27
11 changed files with 79 additions and 65 deletions

View File

@@ -20,9 +20,17 @@ jobs:
- name: Get the latest commit hash
run: echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Update commit file
run: |
echo "{ \"commit\": \"$COMMIT_HASH\" }" > app/commit.json
echo CURRENT_VERSION=$(node -p "require('./package.json').version") >> $GITHUB_ENV
echo "{ \"commit\": \"$COMMIT_HASH\" , \"version\": \"$CURRENT_VERSION\" }" > app/commit.json
- name: Commit and push the update
run: |