File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 5858 default : true
5959
6060jobs :
61+ Validate :
62+ runs-on : ubuntu-latest
63+ permissions :
64+ contents : read
65+ steps :
66+ - name : Checkout
67+ uses : actions/checkout@v3
68+ with :
69+ fetch-depth : 0
70+ - name : Validate new version
71+ if : inputs.new-version
72+ run : |
73+ CURRENT_VERSION=$(node -p "require('./package.json').version")
74+ NEW_VERSION="${{ inputs.new-version }}"
75+
76+ echo "Current version : $CURRENT_VERSION"
77+ echo "New version : $NEW_VERSION"
78+
79+ npx semver -r ">=$CURRENT_VERSION" "$NEW_VERSION" > /dev/null
80+
81+ if [ $? -ne 0 ]; then
82+ echo "❌ New version must be greater than or equal to current version ($CURRENT_VERSION)"
83+ exit 1
84+ fi
6185 Build :
6286 runs-on : ${{ matrix.os }}
6387 permissions :
You can’t perform that action at this time.
0 commit comments