diff --git a/.github/workflows/codechecker.yml b/.github/workflows/codechecker.yml index 3d96e74..5f3fa95 100644 --- a/.github/workflows/codechecker.yml +++ b/.github/workflows/codechecker.yml @@ -16,7 +16,10 @@ jobs: - uses: actions/checkout@v6 with: # Required so the bot can push changes back - fetch-depth: 0 + fetch-depth: 0 + # Check out the real branch (not the detached pull_request merge ref) + # so git-auto-commit can commit the ruff fixes onto it. + ref: ${{ github.head_ref || github.ref_name }} - uses: actions/setup-python@v6 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1016fb2..d723c68 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,8 +15,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v6 - with: - fetch-depth: 0 - name: Detect integration id: integration @@ -27,30 +25,21 @@ jobs: echo "Detected integration: $INTEGRATION" - - name: Update manifest version + - name: Verify manifest version matches the tag run: | - VERSION=${GITHUB_REF_NAME#v} INTEGRATION=${{ steps.integration.outputs.integration }} - - sudo apt-get update - sudo apt-get install -y jq - MANIFEST="custom_components/$INTEGRATION/manifest.json" - tmp=$(mktemp) + TAG_VERSION=${GITHUB_REF_NAME#v} + MANIFEST_VERSION=$(jq -r '.version' "$MANIFEST") - jq --arg version "$VERSION" \ - '.version = $version' \ - "$MANIFEST" > "$tmp" + echo "tag: $GITHUB_REF_NAME -> $TAG_VERSION" + echo "manifest: $MANIFEST_VERSION" - mv "$tmp" "$MANIFEST" - - - name: Commit and push changes - uses: stefanzweifel/git-auto-commit-action@v7 - with: - commit_message: "Bump manifest version to ${{ github.ref_name }} [skip ci]" - file_pattern: "custom_components/**/manifest.json" - branch: main + if [ "$TAG_VERSION" != "$MANIFEST_VERSION" ]; then + echo "::error::Release tag $GITHUB_REF_NAME does not match $MANIFEST version $MANIFEST_VERSION. Bump manifest.json in a commit and tag that commit." + exit 1 + fi - name: Create ZIP run: | diff --git a/custom_components/pfsense/manifest.json b/custom_components/pfsense/manifest.json index f178007..1dc6868 100644 --- a/custom_components/pfsense/manifest.json +++ b/custom_components/pfsense/manifest.json @@ -12,5 +12,5 @@ "requirements": [ "mac-vendor-lookup>=0.1.11" ], - "version": "0.9.1" + "version": "0.9.3" }