Skip to content

Commit b879298

Browse files
authored
Update tag.yml
1 parent f16c41f commit b879298

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

.github/workflows/tag.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@ jobs:
1313
- name: Checkout code
1414
uses: actions/checkout@v3
1515

16-
- name: Get last commit message
17-
id: commit_message
18-
run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" >> $GITHUB_ENV
16+
- name: Get branch name
17+
id: get_branch_name
18+
run: echo "BRANCH_NAME=$(git symbolic-ref --short HEAD)" >> $GITHUB_ENV
1919

2020
- name: Extract version from branch name
2121
id: extract_version
2222
run: |
23-
BRANCH_NAME=$(echo ${{ github.head_ref }} | sed 's/refs\/heads\///')
24-
if [[ $BRANCH_NAME =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
25-
echo "VERSION=$BRANCH_NAME" >> $GITHUB_ENV
23+
if [[ "${{ env.BRANCH_NAME }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
24+
echo "VERSION=${{ env.BRANCH_NAME }}" >> $GITHUB_ENV
2625
else
2726
echo "VERSION=" >> $GITHUB_ENV
2827
fi

0 commit comments

Comments
 (0)