Skip to content

Commit 1e911ea

Browse files
committed
response 12_10_21_17
1 parent 39a4481 commit 1e911ea

2 files changed

Lines changed: 73 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ on:
88
- 'v*'
99
workflow_dispatch:
1010

11+
name: Build and Release Pygame
12+
13+
permissions:
14+
contents: write
15+
1116
jobs:
1217
build:
1318
name: Build on ${{ matrix.os }}

prompts/Response_12_10_21_17.txt

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
Prompt:
2+
The build failed on "Create GitHub Release". The error message is:
3+
Run softprops/action-gh-release@v2
4+
👩‍🏭 Creating new GitHub release for tag v1.0.2...
5+
⚠️ GitHub release failed with status: 403
6+
{"message":"Resource not accessible by integration","documentation_url":"https://docs.github.com/rest/releases/releases#create-a-release","status":"403"}
7+
Skip retry — your GitHub token/PAT does not have the required permission to create a release
8+
⚠️ Unexpected error fetching GitHub release for tag refs/tags/v1.0.2: HttpError: Resource not accessible by integration - https://docs.github.com/rest/releases/releases#create-a-release
9+
Error: Resource not accessible by integration - https://docs.github.com/rest/releases/releases#create-a-release
10+
11+
Response:
12+
Ah, the classic `403` permissions error! Don't worry, there is absolutely nothing wrong with your code or your build process. This is a built-in GitHub security feature stepping in.
13+
14+
By default, GitHub gives the automated `GITHUB_TOKEN` "read-only" access to prevent workflows from accidentally modifying your repository. Because creating a Release involves writing new data (the release notes and the uploaded zip files) to your repo, GitHub blocked it.
15+
16+
You can fix this in one of two ways. The first way (updating the YAML file) is the best practice.
17+
18+
### Option 1: The Code Fix (Recommended)
19+
20+
You just need to explicitly tell GitHub to grant this specific workflow "write" permissions for repository contents.
21+
22+
Open your `build.yml` file and add the `permissions:` block right below your `on:` block, before the `jobs:` start. It should look exactly like this:
23+
24+
```yaml
25+
name: Build and Release Pygame
26+
27+
on:
28+
push:
29+
tags:
30+
- 'v*'
31+
workflow_dispatch:
32+
33+
# --- ADD THIS NEW BLOCK ---
34+
permissions:
35+
contents: write
36+
# --------------------------
37+
38+
jobs:
39+
build:
40+
name: Build on ${{ matrix.os }}
41+
# ... (the rest of your file stays exactly the same)
42+
43+
```
44+
45+
### Option 2: The Settings Fix (Alternative)
46+
47+
If you'd rather change the default behavior for your entire repository so you don't have to add that block to your YAML files, you can do it through the GitHub website:
48+
49+
1. Go to your repository on GitHub.
50+
2. Click on the **Settings** tab.
51+
3. On the left sidebar, scroll down to **Actions** and click **General**.
52+
4. Scroll down to the **Workflow permissions** section.
53+
5. Change the selection from "Read repository contents and packages permissions" to **"Read and write permissions"**.
54+
6. Click **Save**.
55+
56+
---
57+
58+
### How to test the fix:
59+
60+
Since the actual build phase succeeded previously and it only failed at the very end, you know your PyInstaller setup works!
61+
62+
To trigger the release again, just bump your tag version, push it, and watch the magic happen:
63+
64+
```bash
65+
git tag v1.0.3
66+
git push origin v1.0.3
67+
68+
```

0 commit comments

Comments
 (0)