File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,25 @@ jobs:
12
12
- name : Checkout Repository
13
13
uses : actions/checkout@v4
14
14
15
- - name : Get current version from package.json
15
+ - name : Get version from package.json
16
16
id : package_version
17
17
run : echo "VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV
18
18
19
+ - name : Get latest GitHub tag
20
+ id : latest_tag
21
+ run : |
22
+ LATEST_TAG=$(git ls-remote --tags origin | awk -F'/' '{print $3}' | sort -V | tail -n1)
23
+ echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
24
+
25
+ - name : Compare versions
26
+ id : compare_versions
27
+ run : |
28
+ if [ "${{ env.VERSION }}" != "${{ env.LATEST_TAG }}" ]; then
29
+ echo "VERSION_CHANGED=true" >> $GITHUB_ENV
30
+ else
31
+ echo "VERSION_CHANGED=false" >> $GITHUB_ENV
32
+ fi
33
+
19
34
- name : Check if a PR already exists
20
35
id : check_pr
21
36
run : |
25
40
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
26
41
27
42
- name : Create Pull Request
28
- if : env.PR_EXISTS == '0'
43
+ if : env.VERSION_CHANGED == 'true' && env. PR_EXISTS == '0'
29
44
uses : peter-evans/create-pull-request@v5
30
45
with :
31
46
title : " 🚀 Release v${{ env.VERSION }}"
You can’t perform that action at this time.
0 commit comments