Category: Automation

GitHub Actions: git push ends with 403 Resource not accepted error

Read this guide in Polish

Job passes tests, but cannot save the commit to the repository. GITHUB TOKEN can only have read permissions or branch protection rules block the record.

How to determine the source of the error

Check permissions workflow and actual token permissions in the running job.

Verify branch protection and PR policy against automatic entries on the main.

What to do step by step

1. For allowed commit add minimum permissions: contents: write or publish a change by PR when main is protected.

2 . Use action/checkout with proper authentication and only push to the right repo and branch.

How to check the score

The machine saves the change only where it has permission and the protected repo rules remain active.

What to do

Do not disable main protection just to avoid a review. If rules require PR, do not make bypasses through a personal token with wider rights.