File tree Expand file tree Collapse file tree 1 file changed +24
-4
lines changed
Expand file tree Collapse file tree 1 file changed +24
-4
lines changed Original file line number Diff line number Diff line change 5252 - run : pnpm test
5353 if : runner.os != 'Linux'
5454
55+ set-git-tag :
56+ runs-on : ubuntu-latest
57+ outputs :
58+ GIT_TAG : ${{ steps.set-tag.outputs.GIT_TAG }}
59+ steps :
60+ - name : Checkout
61+ uses : actions/checkout@v3
62+
63+ - name : Set GIT_TAG
64+ id : set-tag
65+ run : |
66+ GIT_TAG=$(git describe --tags --abbrev=0)
67+ LATEST_COMMIT=$(git rev-list -n 1 $GIT_TAG)
68+ CURRENT_COMMIT=$(git rev-parse HEAD)
69+ if [ "$LATEST_COMMIT" = "$CURRENT_COMMIT" ]; then
70+ echo "::set-output name=GIT_TAG::${GIT_TAG}"
71+ else
72+ echo "::set-output name=GIT_TAG::"
73+ fi
74+
5575 publish :
56- needs : test
57- if : startsWith(github.ref , 'refs/tags/ v')
76+ needs : [set-git-tag, test]
77+ if : startsWith(needs.set-git-tag.outputs.GIT_TAG , 'v')
5878 runs-on : ubuntu-latest
5979 steps :
6080 - name : Checkout
98118 run : pnpm run publish:open-vsx -p ${{ secrets.OPEN_VSX_TOKEN }}
99119
100120 release :
101- needs : publish
102- if : startsWith(github.ref , 'refs/tags/ v')
121+ needs : [set-git-tag, publish]
122+ if : startsWith(needs.set-git-tag.outputs.GIT_TAG , 'v')
103123 runs-on : ubuntu-latest
104124 steps :
105125 - uses : actions/checkout@v3
You can’t perform that action at this time.
0 commit comments