Skip to content

Commit 604c4f8

Browse files
committed
Use action-get-latest-tag to get latest tag
1 parent 466f93c commit 604c4f8

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

.github/workflows/publish-latest-plugin-zip.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ on:
88
jobs:
99
build:
1010
runs-on: ubuntu-latest
11-
outputs:
12-
tag_name: ${{ steps.get_tag.outputs.tag_name }}
1311

1412
steps:
1513
- name: Checkout code
@@ -20,18 +18,18 @@ jobs:
2018
with:
2119
node-version: "20"
2220

23-
- name: Get tag name
21+
- name: Get latest tag
2422
id: get_tag
25-
run: |
26-
git fetch --tags --force
27-
LATEST_TAG=$(git describe --tags --abbrev=0)
28-
echo "tag_name=$LATEST_TAG" >> $GITHUB_OUTPUT
23+
uses: actions-ecosystem/action-get-latest-tag@v1
24+
with:
25+
semver_only: true
26+
initial_version: 0.0.0
2927

3028
- name: Install dependencies
3129
run: npm ci
3230

3331
- name: Update version to latest trunk commit
34-
run: "find . -type f -exec sed -i 's/0.0.0-placeholder/${{ steps.get_tag.outputs.tag_name }}-${{ github.sha }}/g' {} +"
32+
run: "find . -type f -exec sed -i 's/0.0.0-placeholder/${{ steps.get_tag.outputs.tag }}-${{ github.sha }}/g' {} +"
3533

3634
- name: Build and create plugin zip
3735
run: npm run plugin-zip

0 commit comments

Comments
 (0)