File tree Expand file tree Collapse file tree
custom_components/victron_mqtt Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,17 +18,24 @@ jobs:
1818
1919 - name : Update manifest version
2020 run : |
21- VERSION=${GITHUB_REF_NAME#v}
22- echo "Updating version to $VERSION"
21+ TAG_NAME="${{ github.event.release.tag_name }}"
22+ VERSION="${TAG_NAME#v}"
23+ if [ -z "$VERSION" ] || [ "$VERSION" = "$TAG_NAME" ] && [[ "$TAG_NAME" == "v" ]]; then
24+ echo "::error::Release tag '$TAG_NAME' does not contain a version (expected format: v<version>)"
25+ exit 1
26+ fi
27+ echo "Updating version to $VERSION from tag $TAG_NAME"
2328 jq --arg v "$VERSION" '.version = $v' custom_components/victron_mqtt/manifest.json > tmp.json
2429 mv tmp.json custom_components/victron_mqtt/manifest.json
2530
2631 - name : Commit and push
2732 run : |
33+ VERSION="${{ github.event.release.tag_name }}"
34+ VERSION="${VERSION#v}"
2835 git config user.name "github-actions[bot]"
2936 git config user.email "github-actions[bot]@users.noreply.github.com"
3037 git add custom_components/victron_mqtt/manifest.json
31- git commit -m "Bump version to ${GITHUB_REF_NAME#v }" || exit 0
38+ git commit -m "Bump version to ${VERSION }" || exit 0
3239 git push
3340
3441 - name : Update release tag to include version bump
Original file line number Diff line number Diff line change 1818 "X_MqttOnLan" : " 1"
1919 }
2020 ],
21- "version" : " "
21+ "version" : " 2026.6.5 "
2222}
You can’t perform that action at this time.
0 commit comments