From 4e5912fa28a7e2c6c151b00c184814d90863d09c Mon Sep 17 00:00:00 2001 From: CodingInCarhartts Date: Sun, 14 Dec 2025 19:12:31 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20ci:=20enable=20content=20write?= =?UTF-8?q?=20permissions=20and=20add=20automated=20version=20bumping?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit enhances the npm publish workflow to include automated version bumping and updates necessary permissions and configurations. Changes: - Added contents: write permission to allow pushing version bump commits - Configured git user for automated commits - Added npm version patch step to automatically increment patch version - Added commit and push steps for version changes - Updated version numbers in package.json and src/index.ts - Added token configuration for checkout step for enhanced security --- .github/workflows/publish.yml | 21 ++++++++++++++++++--- package.json | 2 +- src/index.ts | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 86b22e1..1b7fd91 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,17 +5,18 @@ on: branches: [main] paths: - "src/**" - - "package.json" permissions: - id-token: write # ← Required for OIDC - contents: read + id-token: write # Required for OIDC + contents: write # Required to push version bump commit jobs: publish: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} - uses: oven-sh/setup-bun@v2 with: @@ -29,6 +30,20 @@ jobs: - name: Ensure latest npm run: npm install -g npm@latest + - name: Configure git + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Bump version + run: npm version patch --no-git-tag-version + + - name: Commit version bump + run: | + git add package.json + git commit -m "chore: bump version to $(node -p "require('./package.json').version")" || echo "No changes to commit" + git push + - name: Install dependencies run: bun install diff --git a/package.json b/package.json index 42c2dcb..d3b34c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opencode-personal-knowledge", - "version": "1.0.7", + "version": "1.0.8", "description": "Personal knowledge MCP server with vector database for the Opencode ecosystem", "type": "module", "main": "dist/mcp-server.js", diff --git a/src/index.ts b/src/index.ts index 93f0f2c..cd0a330 100644 --- a/src/index.ts +++ b/src/index.ts @@ -22,7 +22,7 @@ const program = new Command(); program .name("pk") .description("Personal Knowledge CLI - Manage your knowledge base") - .version("1.0.1"); + .version("1.0.2"); // Add command program