From 235da3bad062e01d7c1481d376ad761445274464 Mon Sep 17 00:00:00 2001 From: Laurent Goujon Date: Wed, 18 Nov 2026 15:40:52 -0800 Subject: [PATCH 1/2] Fix release plugin version bump to go through a PR main is protected by a ruleset requiring PRs, status checks and review, so the release job's direct push to main was rejected (GH013). The update-plugin-version job now pushes a release/plugin-version- branch, opens a PR, and dispatches CI on it (GITHUB_TOKEN events don't trigger pull_request workflows), so the required checks get reported. Also bump plugin.json to 2.1.3 to match the v2.1.3 release whose bump failed. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 1 + .github/workflows/release.yml | 27 ++++++++++++++++++++--- plugins/dremio/.claude-plugin/plugin.json | 2 +- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f406eb5..da6120d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: branches: [main] pull_request: branches: [main] + workflow_dispatch: permissions: contents: read diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1926cab..231dcec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,10 +37,16 @@ jobs: - uses: pypa/gh-action-pypi-publish@release/v1 update-plugin-version: + # main is protected by a ruleset (PR required, status checks, review), so the + # version bump is proposed as a pull request instead of pushed directly. needs: publish runs-on: ubuntu-latest permissions: contents: write + pull-requests: write + actions: write + env: + GH_TOKEN: ${{ github.token }} steps: - uses: actions/checkout@v6 with: @@ -50,10 +56,25 @@ jobs: VERSION="${GITHUB_REF_NAME#v}" jq --arg v "$VERSION" '.version = $v' plugins/dremio/.claude-plugin/plugin.json > tmp.json mv tmp.json plugins/dremio/.claude-plugin/plugin.json - - name: Commit and push + - name: Open pull request run: | + VERSION="${GITHUB_REF_NAME#v}" + if git diff --quiet; then + echo "plugin.json already at $VERSION, nothing to do" + exit 0 + fi + BRANCH="release/plugin-version-$VERSION" git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" + git checkout -b "$BRANCH" git add plugins/dremio/.claude-plugin/plugin.json - git diff --cached --quiet || git commit -m "chore: bump plugin version to ${GITHUB_REF_NAME#v}" - git push + git commit -m "chore: bump plugin version to $VERSION" + git push --force origin "$BRANCH" + if [ -z "$(gh pr list --head "$BRANCH" --state open --json number --jq '.[].number')" ]; then + gh pr create --base main --head "$BRANCH" \ + --title "chore: bump plugin version to $VERSION" \ + --body "Automated plugin.json version bump for release $GITHUB_REF_NAME." + fi + # Events raised with GITHUB_TOKEN do not trigger pull_request workflows, + # so dispatch CI on the branch to produce the required status checks. + gh workflow run ci.yml --ref "$BRANCH" diff --git a/plugins/dremio/.claude-plugin/plugin.json b/plugins/dremio/.claude-plugin/plugin.json index 8f3c6e4..aea7c61 100644 --- a/plugins/dremio/.claude-plugin/plugin.json +++ b/plugins/dremio/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "schema_version": "1.0", "name": "dremio", - "version": "2.1.2", + "version": "2.1.3", "description": "Dremio Cloud developer skills — SQL reference, setup wizard, dbt integration, and workflow automations powered by the drs CLI.", "skills": [ "skills/dremio", From 57793bb1af6d0902b170ad7e8afefbb8d728fdfa Mon Sep 17 00:00:00 2001 From: Laurent Goujon Date: Wed, 18 Nov 2026 16:02:08 -0800 Subject: [PATCH 2/2] Push plugin version bump as dremio-release-bot instead of opening a PR Replace the PR + CI-dispatch flow with a direct push to main using a short-lived dremio-release-bot App token, scoped to this repo and contents:write. The App is the "Lock main" ruleset bypass actor; its key is stored in the pypi environment, restricted to v* tags. Reverts the workflow_dispatch trigger on CI, which is no longer needed. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 1 - .github/workflows/release.yml | 46 ++++++++++++++--------------------- 2 files changed, 18 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da6120d..f406eb5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,6 @@ on: branches: [main] pull_request: branches: [main] - workflow_dispatch: permissions: contents: read diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 231dcec..e40878d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,44 +37,34 @@ jobs: - uses: pypa/gh-action-pypi-publish@release/v1 update-plugin-version: - # main is protected by a ruleset (PR required, status checks, review), so the - # version bump is proposed as a pull request instead of pushed directly. + # main is protected by the "Lock main" ruleset; dremio-release-bot is its + # only bypass actor. Its key lives in the pypi environment, which only v* + # tags can deploy to, so no other workflow or branch can read it. needs: publish runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - actions: write - env: - GH_TOKEN: ${{ github.token }} + environment: pypi + permissions: {} steps: + - uses: actions/create-github-app-token@f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc # v3.4.0 + id: app-token + with: + client-id: Iv23liSGL4udxvGMF91W # dremio-release-bot + private-key: ${{ secrets.DREMIO_RELEASE_BOT_PRIVATE_KEY }} + repositories: cli + permission-contents: write - uses: actions/checkout@v6 with: ref: main + token: ${{ steps.app-token.outputs.token }} - name: Update plugin.json version run: | VERSION="${GITHUB_REF_NAME#v}" jq --arg v "$VERSION" '.version = $v' plugins/dremio/.claude-plugin/plugin.json > tmp.json mv tmp.json plugins/dremio/.claude-plugin/plugin.json - - name: Open pull request + - name: Commit and push run: | - VERSION="${GITHUB_REF_NAME#v}" - if git diff --quiet; then - echo "plugin.json already at $VERSION, nothing to do" - exit 0 - fi - BRANCH="release/plugin-version-$VERSION" - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git checkout -b "$BRANCH" + git config user.name "dremio-release-bot[bot]" + git config user.email "223908024+dremio-release-bot[bot]@users.noreply.github.com" git add plugins/dremio/.claude-plugin/plugin.json - git commit -m "chore: bump plugin version to $VERSION" - git push --force origin "$BRANCH" - if [ -z "$(gh pr list --head "$BRANCH" --state open --json number --jq '.[].number')" ]; then - gh pr create --base main --head "$BRANCH" \ - --title "chore: bump plugin version to $VERSION" \ - --body "Automated plugin.json version bump for release $GITHUB_REF_NAME." - fi - # Events raised with GITHUB_TOKEN do not trigger pull_request workflows, - # so dispatch CI on the branch to produce the required status checks. - gh workflow run ci.yml --ref "$BRANCH" + git diff --cached --quiet || git commit -m "chore: bump plugin version to ${GITHUB_REF_NAME#v}" + git push