Skip to content

Commit ba5befe

Browse files
committed
Replace placeholder version with tag-dev-sha for latest trunk releases
1 parent e238c36 commit ba5befe

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

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

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: Publish plugin to Automattic/create-content-model-releases latest on trunk merge
22

33
on:
4-
push:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
56
branches:
67
- trunk
78

@@ -12,6 +13,14 @@ jobs:
1213
steps:
1314
- name: Checkout code
1415
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Get most recent tag
20+
id: get_tag
21+
uses: WyriHaximus/github-action-get-previous-tag@v1
22+
with:
23+
fallback: 1.0.0
1524

1625
- name: Setup Node.js
1726
uses: actions/setup-node@v4
@@ -21,6 +30,9 @@ jobs:
2130
- name: Install dependencies
2231
run: npm ci
2332

33+
- 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 }}-dev-${{ github.sha }}/g' {} +"
35+
2436
- name: Build and create plugin zip
2537
run: npm run plugin-zip
2638

@@ -51,4 +63,4 @@ jobs:
5163
destination-repository-name: "create-content-model-releases"
5264
user-name: ${{ github.actor }}
5365
user-email: ${{ steps.get_email.outputs.email }}
54-
target-branch: latest
66+
target-branch: test

0 commit comments

Comments
 (0)