Skip to content

Commit 7fb7278

Browse files
authored
Merge pull request #16 from useblacksmith/fix-workflow-permissions-properly
Fix: Properly handle workflow file modifications in releases
2 parents c4fd462 + e6f0577 commit 7fb7278

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

.github/workflows/rebase-upstream.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
permissions:
1010
contents: write
1111
issues: write
12-
workflows: write
1312

1413
jobs:
1514
rebase:
@@ -19,7 +18,7 @@ jobs:
1918
uses: actions/checkout@v4
2019
with:
2120
fetch-depth: 0
22-
token: ${{ secrets.GITHUB_TOKEN }}
21+
token: ${{ secrets.WORKFLOW_TOKEN || secrets.GITHUB_TOKEN }}
2322

2423
- name: Setup git
2524
run: |

.github/workflows/release-patched-version.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ on:
1515

1616
permissions:
1717
contents: write
18-
workflows: write
1918

2019
jobs:
2120
create-patched-release:
@@ -29,7 +28,7 @@ jobs:
2928
uses: actions/checkout@v4
3029
with:
3130
fetch-depth: 0
32-
token: ${{ secrets.GITHUB_TOKEN }}
31+
token: ${{ secrets.WORKFLOW_TOKEN || secrets.GITHUB_TOKEN }}
3332

3433
- name: Setup git
3534
run: |

DEPLOYMENT.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44

55
This fork maintains patches on top of upstream BuildKit using a rebase workflow. Our `master` branch contains upstream BuildKit plus our custom patches rebased on top.
66

7+
## Setup Requirements
8+
9+
If your patches modify workflow files (`.github/workflows/*.yml`), you need to create a Personal Access Token:
10+
11+
1. Go to GitHub Settings > Developer settings > Personal access tokens
12+
2. Create a new token with `repo` and `workflow` scopes
13+
3. Add it as a secret named `WORKFLOW_TOKEN` in your repository settings
14+
15+
Without this token, the workflows will fall back to using `GITHUB_TOKEN`, which cannot push workflow changes.
16+
717
## Creating a Patched Release
818

919
To deploy a patched version of BuildKit:

0 commit comments

Comments
 (0)