Skip to content

fix(ci): grant packages:write to maven-publish deploy job#75

Merged
cernadasjuan merged 1 commit into
masterfrom
fix/maven-publish-permissions
May 27, 2026
Merged

fix(ci): grant packages:write to maven-publish deploy job#75
cernadasjuan merged 1 commit into
masterfrom
fix/maven-publish-permissions

Conversation

@cernadasjuan
Copy link
Copy Markdown
Contributor

Summary

  • Add explicit permissions: { contents: read, packages: write } to the deploy job in .github/workflows/maven-publish.yml.
  • Fixes recent HTTP 403 Forbidden failures from mvn deploy against maven.pkg.github.com/pluggyai/pluggy-java.

Why it broke "out of nowhere"

The job had no permissions: block, so GITHUB_TOKEN inherited the org/repo default. GitHub no longer grants packages: write by default in many configurations — once that default tightens, the token is valid but cannot push packages, and the deploy step gets a 403. release.yml already declares its own permissions; this change brings maven-publish.yml in line with that pattern.

Test plan

🤖 Generated with Claude Code

Restores GitHub Packages deploys after they started failing with HTTP
403. The deploy job did not declare a `permissions:` block, so it
inherited the org-wide default for GITHUB_TOKEN. When that default does
not include `packages: write`, the maven-deploy step is rejected by
maven.pkg.github.com regardless of the token being valid.

Declaring the permission at the job level makes the workflow
self-sufficient and consistent with release.yml, which already pins its
own permissions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@jhonatan-pluggy jhonatan-pluggy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cernadasjuan cernadasjuan merged commit a971bb9 into master May 27, 2026
2 of 3 checks passed
@cernadasjuan cernadasjuan deleted the fix/maven-publish-permissions branch May 27, 2026 15:32
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.

2 participants