@ceylar/ada 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,9 +2,7 @@ name: Publish Package to npm
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [main, master]
6
- pull_request:
7
- branches: [main, master]
5
+ branches: [main]
8
6
 
9
7
  jobs:
10
8
  build:
@@ -0,0 +1,38 @@
1
+ name: Version Check
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+
7
+ jobs:
8
+ check-version:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ with:
13
+ fetch-depth: 0
14
+
15
+ - name: Get base (target) branch version
16
+ id: base-version
17
+ run: |
18
+ git fetch origin ${{ github.base_ref }}
19
+ BASE_VERSION=$(git show origin/${{ github.base_ref }}:package.json | jq -r .version)
20
+ echo "base_version=$BASE_VERSION" >> $GITHUB_OUTPUT
21
+
22
+ - name: Get current (PR) branch version
23
+ id: pr-version
24
+ run: |
25
+ PR_VERSION=$(jq -r .version package.json)
26
+ echo "pr_version=$PR_VERSION" >> $GITHUB_OUTPUT
27
+
28
+ - name: Compare versions
29
+ run: |
30
+ BASE=${{ steps.base-version.outputs.base_version }}
31
+ PR=${{ steps.pr-version.outputs.pr_version }}
32
+
33
+ if [ "$BASE" = "$PR" ]; then
34
+ echo "::error::Version in package.json must be incremented! Current: $PR, expected higher than $BASE"
35
+ exit 1
36
+ fi
37
+
38
+ echo "Version increased from $BASE to $PR - validation passed"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ceylar/ada",
3
3
  "description": "CLI to help you initialize projects",
4
- "version": "0.0.7",
4
+ "version": "0.0.9",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "bin": {