Skip to content

Commit 0ae70c0

Browse files
vaindclaude
andauthored
docs(updater): Update authentication documentation for ssh-key and api-token inputs (#136)
Update the updater README to accurately document both authentication inputs that were added in v3.1.0: - Fix api-token input: change from required:true to required:false - Add comprehensive documentation for ssh-key input parameter - Add usage examples showing ssh-key alone and combined with api-token - Add Authentication section with three clear options and guidance - Clarify that CI runs on PRs when using SSH keys for git operations The documentation now reflects that both inputs are optional and can be used independently or together, providing users clear guidance on which authentication method to choose based on their requirements. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
1 parent df41e0d commit 0ae70c0

File tree

1 file changed

+67
-3
lines changed

1 file changed

+67
-3
lines changed

updater/README.md

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,28 @@ jobs:
107107
name: Cocoa SDK
108108
post-update-script: scripts/post-update.sh # Receives args: $1=old version, $2=new version
109109
api-token: ${{ secrets.CI_DEPLOY_KEY }}
110+
111+
# Authentication with SSH deploy key (git operations via SSH, API via default token)
112+
cocoa-ssh:
113+
runs-on: ubuntu-latest
114+
steps:
115+
- uses: getsentry/github-workflows/updater@v3
116+
with:
117+
path: modules/sentry-cocoa
118+
name: Cocoa SDK
119+
ssh-key: ${{ secrets.CI_DEPLOY_KEY }}
120+
121+
# Authentication with both SSH key and API token (git via SSH, API via token)
122+
# This is useful when you need CI to run on created PRs and use a deploy key
123+
cocoa-ssh-and-token:
124+
runs-on: ubuntu-latest
125+
steps:
126+
- uses: getsentry/github-workflows/updater@v3
127+
with:
128+
path: modules/sentry-cocoa
129+
name: Cocoa SDK
130+
ssh-key: ${{ secrets.CI_DEPLOY_KEY }}
131+
api-token: ${{ secrets.CI_GITHUB_TOKEN }}
110132
```
111133
112134
## Inputs
@@ -153,11 +175,53 @@ jobs:
153175
* type: string
154176
* required: false
155177
* default: ''
156-
* `api-token`: Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}`.
178+
* `api-token`: GitHub API token for repository operations. Can be passed in using `${{ secrets.GITHUB_TOKEN }}`.
157179
If you provide the usual `${{ github.token }}`, no followup CI will run on the created PR.
158-
If you want CI to run on the PRs created by the Updater, you need to provide custom user-specific auth token.
180+
If you want CI to run on the PRs created by the Updater, you need to provide a custom user-specific auth token.
181+
Not required if `ssh-key` is provided, but can be used together with `ssh-key` for GitHub API operations.
159182
* type: string
160-
* required: true
183+
* required: false
184+
* default: ''
185+
* `ssh-key`: SSH private key for repository authentication (e.g., deploy key). Can be used alone or together with `api-token`.
186+
When used alone, the action will use SSH for git operations and fall back to the default GitHub token for API operations.
187+
When used with `api-token`, SSH is used for git operations and the token is used for GitHub API operations.
188+
* type: string
189+
* required: false
190+
* default: ''
191+
192+
## Authentication
193+
194+
The updater supports multiple authentication methods. Choose based on your requirements:
195+
196+
### Option 1: API Token Only (Default)
197+
198+
```yaml
199+
api-token: ${{ secrets.GITHUB_TOKEN }}
200+
```
201+
202+
* **Use when**: Standard GitHub token authentication is sufficient
203+
* **Limitation**: If using `${{ github.token }}`, CI workflows won't run on created PRs
204+
* **Solution**: Use a personal access token or GitHub App token to enable CI on PRs
205+
206+
### Option 2: SSH Key Only
207+
208+
```yaml
209+
ssh-key: ${{ secrets.CI_DEPLOY_KEY }}
210+
```
211+
212+
* **Use when**: Repository access requires SSH (e.g., deploy keys)
213+
* **Behavior**: Git operations use SSH (CI will run on PRs since commits are made with SSH key), API operations use default GitHub token
214+
215+
### Option 3: SSH Key + API Token (Recommended for Deploy Keys)
216+
217+
```yaml
218+
ssh-key: ${{ secrets.CI_DEPLOY_KEY }}
219+
api-token: ${{ secrets.CI_GITHUB_TOKEN }}
220+
```
221+
222+
* **Use when**: You need both deploy key access AND want to control the API token used for GitHub operations
223+
* **Behavior**: Git operations use SSH deploy key, API operations use provided token
224+
* **Benefits**: Full control over authentication for both git and API operations
161225

162226
### Post-Update Script Example
163227

0 commit comments

Comments
 (0)