Skip to content

Commit

Permalink
Fixed broken start engine call (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasLaross authored Apr 11, 2024
1 parent 01dc69c commit 4b00bd3
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 4 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,19 @@ jobs:
git tag "v$VERSION"
git push origin "v$VERSION"
- name: Read changelog notes
id: changelog-notes
run: |
BODY=$(tail -n +2 CHANGELOG)
echo "::set-output name=body::$BODY"
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} # Set the GitHub App token as GITHUB_TOKEN environment variable
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
with:
tag_name: v${{ env.VERSION }}
release_name: Release v${{ env.VERSION }}
release_name: v${{ env.VERSION }}
body: ${{ steps.changelog-notes.outputs.body }}
draft: false
prerelease: false
35 changes: 35 additions & 0 deletions .github/workflows/verify-release-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Verify Version Match

on:
pull_request:
branches:
- main
paths:
- 'custom_components/lynkco/manifest.json'

jobs:
verify-version-match:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Extract version from manifest.json
id: manifest-version
run: |
VERSION=$(jq -r '.version' custom_components/lynkco/manifest.json)
echo "::set-output name=version::$VERSION"
- name: Extract first line from changelog
id: changelog-version
run: |
FIRST_LINE=$(head -n 1 CHANGELOG)
echo "::set-output name=first_line::$FIRST_LINE"
- name: Compare versions
run: |
if [ "${{ steps.manifest-version.outputs.version }}" != "${{ steps.changelog-version.outputs.first_line }}" ]; then
echo "Error: Version mismatch detected. manifest.json version: ${{ steps.manifest-version.outputs.version }}, CHANGELOG version: ${{ steps.changelog-version.outputs.first_line }}"
exit 1
fi
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0.1.6
Fixed broken start engine call
2 changes: 1 addition & 1 deletion custom_components/lynkco/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async def manual_update_data_service(call):
await manual_update_data(hass, entry)

async def start_engine_service(call):
await start_engine(hass, vin, call.get("duration_in_minutes", 15))
await start_engine(hass, vin, call.data.get("duration_in_minutes", 15))

async def stop_engine_service(call):
await stop_engine(hass, vin)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/lynkco/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Lynk & Co",
"documentation": "https://www.github.com/tobiaslaross/Hass-Lynk-Co",
"config_flow": true,
"version": "0.1.5",
"version": "0.1.6",
"requirements": [
"requests>=2.31.0",
"pkce>=1.0.3"
Expand Down

0 comments on commit 4b00bd3

Please sign in to comment.