mirror of
https://github.com/NocturnLabs/opencode-personal-knowledge.git
synced 2026-07-18 08:05:59 +02:00
👷 ci: enable content write permissions and add automated version bumping
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
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user