You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## what
- Updates info about the tokens usage.
- Reverts changes of the removed release (v0.1.1)
## why
- Readme was confusing.
- Release v0.1.1 was removed as it contained a workaround for permission
issues. They were appropriately fixed by mitigating the root cause; no
WA was needed.
## references
- N/A
Copy file name to clipboardExpand all lines: README.md
+21-13Lines changed: 21 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,14 +10,14 @@
10
10
11
11
A reusable GitHub Action for automated [Trunk](https://trunk.io) upgrades with status check handling and auto-merge.
12
12
13
-
This action automates the process of keeping your Trunk configuration up-to-date by creating pull requests for upgrades and automatically merging them after status checks pass. It follows security best practices with dual-token authentication and only waits for required status checks, avoiding unnecessary delays from optional checks.
13
+
This action automates the process of keeping your Trunk configuration up-to-date by creating pull requests for upgrades and automatically merging them after status checks pass. It follows security best practices with a two-token setup and only waits for required status checks, avoiding unnecessary delays from optional checks.
14
14
15
15
## Usage
16
16
17
17
### Prerequisites
18
18
19
19
- GitHub repository with Trunk configuration
20
-
- Personal Access Token (required)
20
+
- Personal Access Token from a code owner or team member (required)
21
21
- GitHub App credentials (recommended for enhanced performance and security)
22
22
- Repository permissions: `contents: write` and `pull-requests: write`
23
23
@@ -26,7 +26,7 @@ This action automates the process of keeping your Trunk configuration up-to-date
26
26
1.**Set up authentication secrets** in your repository:
27
27
-`BOT_APP_ID` - GitHub App ID
28
28
-`BOT_APP_PRIVATE_KEY` - GitHub App private key
29
-
-`ORG_PAT` - Personal Access Token with admin permissions
29
+
-`CODE_OWNER_PAT` - Personal Access Token from a code owner or team member
- Used for merge operations to satisfy code owner requirements
106
+
- Should be from a user who is a code owner or team member
107
+
- Required for repositories with code owner review requirements
108
+
- Bypasses the "can't approve own PR" limitation
108
109
- Falls back if no App credentials provided
109
110
111
+
**Why Two-Token Setup is Recommended:**
112
+
113
+
Many repositories have branch protection rules requiring code owner reviews. When a GitHub App creates a PR, it cannot approve its own PR due to GitHub's security model. The two-token approach solves this by:
114
+
115
+
- **App creates the PR** → Clean bot attribution
116
+
- **Code owner PAT approves/merges** → Satisfies repository protection rules
117
+
110
118
**Token Selection Logic:**
111
119
112
-
- If App credentials provided → Use App token for PR creation, PAT for merge
113
-
- If no App credentials → Use PAT for both operations
120
+
- If App credentials provided → Use App token for PR creation, PAT for approval/merge
121
+
- If no App credentials → Use PAT for both operations (**Note**: This won't work if the repository has rulesets or branch protection rules requiring code owner reviews, since the same user/token cannot create and approve their own PR)
0 commit comments