Skip to content

Commit 2d1b52e

Browse files
authored
[ITEP-68209] Add parsing of version.txt for rc version for build (#236)
## 📝 Description This PR adds parsing logic for release candidate (RC) versions from version.txt file in the build workflow. It modifies the weekly build workflow to handle RC versions differently by using the version.txt content directly as the image tag when it contains "rc". Key Changes: - Added error handling when version.txt file is not found - Added conditional logic to detect RC versions and use them directly as image tags - Modified existing tag generation logic to accommodate RC version handling <!-- If the PR addresses a specific GitHub issue, include one of the following lines to enable auto-closing: Fixes #<issue_number> Closes #<issue_number> If referencing an internal ticket (e.g. JIRA), include the ticket number instead: JIRA: <project-key>-<ticket-number> If there’s no related issue or ticket, you can skip this section. --> ## ✨ Type of Change Select the type of change your PR introduces: - [ ] 🐞 **Bug fix** – Non-breaking change which fixes an issue - [ ] 🚀 **New feature** – Non-breaking change which adds functionality - [ ] 🔨 **Refactor** – Non-breaking change which refactors the code base - [ ] 💥 **Breaking change** – Changes that break existing functionality - [ ] 📚 **Documentation update** - [ ] 🔒 **Security update** - [ ] 🧪 **Tests** - [ ] 🚂 **CI** ## 🧪 Testing Scenarios Describe how the changes were tested and how reviewers can test them too: - [ ] ✅ Tested manually - [ ] 🤖 Ran automated end-to-end tests ## ✅ Checklist Before submitting the PR, ensure the following: - [ ] 🔍 PR title is clear and descriptive - [ ] 📝 For internal contributors: If applicable, include the JIRA ticket number (e.g., ITEP-123456) in the PR **title**. Do **not** include full URLs - [ ] 💬 I have commented my code, especially in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ✅ I have added tests that prove my fix is effective or my feature works
1 parent 004415a commit 2d1b52e

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

.github/workflows/weekly-build.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,24 @@ jobs:
6060
version=""
6161
if [ -f version.txt ]; then
6262
version=v$(tr -d ' \n' < version.txt)
63+
else
64+
echo "version.txt not found."
65+
exit 1
6366
fi
64-
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
65-
commit_hash=$(git rev-parse --short HEAD)
66-
tag="${version:+$version-}$commit_hash"
67+
# If version.txt contains "rc", use its content as image tag
68+
if grep -q "rc" version.txt; then
69+
tag="$version"
6770
echo "image_tag=$tag" >> $GITHUB_OUTPUT
6871
else
69-
date_tag=$(date -u +'%Y%m%d')
70-
tag="${version:+$version-}$date_tag"
71-
echo "image_tag=$tag" >> $GITHUB_OUTPUT
72+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
73+
commit_hash=$(git rev-parse --short HEAD)
74+
tag="${version:+$version-}$commit_hash"
75+
echo "image_tag=$tag" >> $GITHUB_OUTPUT
76+
else
77+
date_tag=$(date -u +'%Y%m%d')
78+
tag="${version:+$version-}$date_tag"
79+
echo "image_tag=$tag" >> $GITHUB_OUTPUT
80+
fi
7281
fi
7382
7483
- name: "Tag images"

0 commit comments

Comments
 (0)