Skip to content

Commit 91cdc55

Browse files
Enhance VERSION file creation in workflow
Updated the VERSION file creation process to include a timestamp and handle no changes gracefully.
1 parent 6a7a1f9 commit 91cdc55

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

.github/workflows/publish_release.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,18 @@ jobs:
3434
3535
- name: Create branch and commit VERSION
3636
run: |
37-
branch="update-version-${{ steps.draft.outputs.tag_name }}"
38-
git push origin --delete "$branch" || echo "No remote branch to delete"
39-
git fetch origin main
40-
git checkout -b "$branch" origin/main
41-
echo "${{ steps.draft.outputs.tag_name }}" | sed 's/^v//' > VERSION
42-
git add VERSION
43-
git config user.name "github-actions[bot]"
44-
git config user.email "github-actions[bot]@users.noreply.github.com"
45-
git commit -m "chore: add VERSION ${{ steps.draft.outputs.tag_name }}"
46-
git push --set-upstream origin "$branch"
47-
37+
branch="update-version-${{ steps.draft.outputs.tag_name }}"
38+
git push origin --delete "$branch" || echo "No remote branch to delete"
39+
git fetch origin main
40+
git checkout -b "$branch" origin/main
41+
version="${{ steps.draft.outputs.tag_name }}"
42+
echo "$version" | sed 's/^v//' > VERSION
43+
echo "# generated at $(date +%s)" >> VERSION
44+
git add VERSION
45+
git config user.name "github-actions[bot]"
46+
git config user.email "github-actions[bot]@users.noreply.github.com"
47+
git commit -m "chore: add VERSION $version" || echo "No changes"
48+
git push --set-upstream origin "$branch"
4849
4950
- name: Create pull request
5051
id: pr

0 commit comments

Comments
 (0)