Skip to content

Grant contents: write so the deploy workflow can publish the site - #205

Merged
yfre merged 1 commit into
masterfrom
ci/site-deploy-contents-write
Oct 18, 2026
Merged

yfre merged 1 commit into
masterfrom
ci/site-deploy-contents-write

Conversation

@yfre

@yfre yfre commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Problem

The "Publish site" step of the Java CI with Maven and Deploy workflow fails on every push to master:

Failed to check-in files to SCM: The git-push command failed.
remote: Permission to hap-java/HAP-Java.git denied to github-actions[bot].
... The requested URL returned error: 403

Commit 5a8f948 ("publish to GitHub Packages instead") added a top-level permissions: block with only packages: write. When a workflow declares permissions, every scope it leaves out is set to none, so the GITHUB_TOKEN loses contents: write, and maven-scm-publish-plugin can't push to gh-pages. The snapshot publish to GitHub Packages in the same job still succeeds.

The gh-pages branch was last updated on 2023-03-02, so the published site is stale.

Change

Add contents: write next to packages: write in .github/workflows/deploy.yml. Nothing else changes.

Verification

The workflow only runs on pushes to master, so this PR can't exercise it. After merging, the "Publish site" step of that run should succeed, and gh-pages should get a new "Site checkin for project hap-java" commit.

🤖 Generated with Claude Code

…ages

The permissions block added in 5a8f948 only granted packages: write,
which drops the GITHUB_TOKEN's contents scope. maven-scm-publish-plugin
then fails to push the site to gh-pages with a 403.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yfre
yfre merged commit 3f5f58a into master Oct 18, 2026
1 check passed
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