Skip to content

fix(ci): grant contents:write to build job for JReleaser release#101

Merged
katayama8000 merged 1 commit into
masterfrom
fix/ci-release-permissions
Jul 2, 2026
Merged

fix(ci): grant contents:write to build job for JReleaser release#101
katayama8000 merged 1 commit into
masterfrom
fix/ci-release-permissions

Conversation

@katayama8000

Copy link
Copy Markdown
Contributor

概要

master への push で走る Build and Release ワークフロー(build.yml)の JReleaser full-release ステップが 403 Forbidden で失敗している問題を修正します。

参考: 失敗した CI 実行 https://github.com/nulab/backlog4j/actions/runs/28573715743

原因

[INFO]  Releasing to https://github.com/nulab/backlog4j@master
[DEBUG] deleting release early-access from nulab/backlog4j
jreleaser.shadow.org.jreleaser.sdk.commons.RestAPIException: 403: Forbidden
{"message":"Resource not accessible by integration", ... "status":"403"}
  • ビルド・テスト・Maven Central (snapshot) デプロイはすべて成功しており、失敗しているのは GitHub リリース(early-access)の削除・再作成部分のみ。
  • ワークフロー YAML 自体は 2025-07-09 以降変更されておらず、前回の master push(2025-07-14)は成功していた。
  • 変わったのはリポジトリ側の設定で、default_workflow_permissions が現在 read(読み取り専用)になっている。以前は write だったため YAML に permissions: を書かなくても GITHUB_TOKEN でリリースを操作できていた。
  • 今回のマージがデフォルト権限変更後の最初の master push だったため顕在化した(コード変更とは無関係)。

修正内容

build ジョブに permissions: contents: write を明示的に付与し、リポジトリ/組織のデフォルト権限に依存せずリリース操作が行えるようにする。

jobs:
  build:
    runs-on: ubuntu-latest

    permissions:
      contents: write

🤖 Generated with Claude Code

The repository's default GITHUB_TOKEN permission is now read-only, so
JReleaser's full-release step fails with 403 Forbidden when it tries to
delete/recreate the early-access GitHub release. Explicitly request
contents:write at the job level so the release step works regardless of
the repo/org default workflow permission.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@katayama8000 katayama8000 merged commit eac7d26 into master Jul 2, 2026
1 check passed
@katayama8000 katayama8000 deleted the fix/ci-release-permissions branch July 2, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant