File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ The new version is saved in the output.
2424 skip_ci : true
2525 prerelease : false
2626 only_tag : false
27+
2728
2829- run : echo "${{ steps.release.outputs.version }}"
2930` ` `
@@ -38,6 +39,7 @@ The new version is saved in the output.
3839| skip_ci | True if you want skip CI workflows on commit release | false | `boolean` | true |
3940| prerelease | True if it is a prerelease | false | `boolean` | false |
4041| only_tag | True to create only the Tag without the Release | false | `boolean` | false |
42+ | package_path | Path leading to package.json file | false | `string` | ./ |
4143
4244# # Output
4345
Original file line number Diff line number Diff line change @@ -35,6 +35,11 @@ inputs:
3535 type : boolean
3636 description : True to create only the Tag without the Release
3737 default : false
38+ package_path :
39+ required : false
40+ type : string
41+ description : Path leading to package.json file
42+ default : " ./"
3843
3944
4045outputs :
@@ -69,10 +74,12 @@ runs:
6974
7075 - id : get_version
7176 name : Get Version
77+ env :
78+ PACKAGE_PATH : ${{ inputs.package_path }}
7279 run : |
73- PACKAGE_FILE="package.json"
80+ PACKAGE_FILE="${PACKAGE_PATH} package.json"
7481 if [[ -f "$PACKAGE_FILE" ]]; then
75- echo "version=$(node -p "require('./ package.json').version")" >> $GITHUB_ENV
82+ echo "version=$(node -p "require('${PACKAGE_PATH} package.json').version")" >> $GITHUB_ENV
7683 fi
7784 shell : bash
7885
@@ -100,9 +107,11 @@ runs:
100107 - name : Push New Version
101108 if : ${{ inputs.semver != 'skip' }}
102109 shell : bash
110+ env :
111+ PACKAGE_PATH : ${{ inputs.package_path }}
103112 run : |
104- contents="$(jq '.version = "${{ steps.semver.outputs.new_version }}"' package.json)"
105- echo -E "${contents}" > package.json
113+ contents="$(jq '.version = "${{ steps.semver.outputs.new_version }}"' ${PACKAGE_PATH} package.json)"
114+ echo -E "${contents}" > ${PACKAGE_PATH} package.json
106115
107116 git add .
108117 git config --global user.email "[email protected] "
You can’t perform that action at this time.
0 commit comments