File tree Expand file tree Collapse file tree 1 file changed +29
-2
lines changed Expand file tree Collapse file tree 1 file changed +29
-2
lines changed Original file line number Diff line number Diff line change 2525
2626permissions :
2727 pull-requests : write
28+ contents : write # Required for GitHub Pages upload
2829
2930jobs :
3031 coverage :
@@ -250,10 +251,36 @@ The action automatically uploads badges to your GitHub Pages branch when `upload
250251
251252### Required Permissions
252253
253- For automatic GitHub Pages upload, your workflow needs:
254+ For automatic GitHub Pages upload, your workflow MUST include these permissions:
255+
256+ ``` yaml
257+ permissions :
258+ pull-requests : write # For creating/updating PR comments
259+ contents : write # For uploading badges to GitHub Pages
260+ ` ` `
261+
262+ **Without ` contents: write` permission, you'll see this error:**
263+
264+ ```
265+ Warning: Failed to upload badges to GitHub Pages: Resource not accessible by integration
266+ ```
267+
268+ ### Troubleshooting
269+
270+ #### "Resource not accessible by integration" Error
271+
272+ This error occurs when the action doesn't have sufficient permissions to create git references or push to branches.
273+
274+ **Solution:** Add the required permissions to your workflow:
254275
255276```yaml
256277permissions:
257278 pull-requests: write
258- contents : write # Required for uploading to GitHub Pages
279+ contents: write
259280```
281+
282+ #### "Branch not found" Error
283+
284+ This error occurs when the action can't find the default branch to create the gh-pages branch from.
285+
286+ ** Solution:** Make sure your repository has a default branch (usually ` main ` or ` master ` ) and the action has ` contents: write ` permission.
You can’t perform that action at this time.
0 commit comments