File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Tag Latest
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+
8
+ jobs :
9
+ tag :
10
+ if : github.repository == 'orangehrm/oxd'
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - uses : actions/checkout@v3
14
+
15
+ - name : Check version already published
16
+ run : |
17
+ set -x
18
+ npm -v
19
+ current_version=$(npm pkg get version | sed 's/"//g')
20
+ fetched_current_version=$(npm show @ohrm/oxd@$current_version version) || fetched_current_version=''
21
+ echo "current_version=$current_version" >> $GITHUB_ENV
22
+ echo "fetched_current_version=$fetched_current_version" >> $GITHUB_ENV
23
+ echo "current_published_version=$(npm show @ohrm/oxd version)" >> $GITHUB_ENV
24
+
25
+ - name : Tag as latest
26
+ run : |
27
+ current_version=${{ env.current_version }}
28
+ npm dist-tag add @ohrm/oxd@$current_version latest
29
+ env :
30
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments