Skip to content

Commit c2a1f13

Browse files
Jeffreyhunglizokm
andauthored
feat(releases): Update docs to use GitHub App instead of service account PAT (#11805)
* use Github App instead of PAT * include instructions for creating rulesets * fix syntaxs * Move the json file to the public folder * Testing * dummy commit to trigger build on docs site * revert dummy change * fix the link to json file * Apply suggestions from code review Co-authored-by: Liza Mock <[email protected]> * fix the link * update the action app version * not required codeowner review by default * update default ruleset to include `release-bot` team for getsentry-bot --------- Co-authored-by: Liza Mock <[email protected]>
1 parent 4ebe9bf commit c2a1f13

File tree

2 files changed

+60
-4
lines changed

2 files changed

+60
-4
lines changed

develop-docs/sdk/processes/releases.mdx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Nice!
8484

8585
This file is used to trigger the release from the GitHub UI.
8686

87-
You'll notice it uses `secrets.GH_RELEASE_PAT` -- this should already be
87+
You'll notice it uses `vars.SENTRY_RELEASE_BOT_CLIENT_ID` and `secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY` -- these should be
8888
available to your repository automatically!
8989

9090
```yaml
@@ -105,14 +105,20 @@ jobs:
105105
runs-on: ubuntu-latest
106106
name: "Release a new version"
107107
steps:
108+
- name: Get auth token
109+
id: token
110+
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
111+
with:
112+
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
113+
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
108114
- uses: actions/checkout@v3
109115
with:
110-
token: ${{ secrets.GH_RELEASE_PAT }}
116+
token: ${{ steps.token.outputs.token }}
111117
fetch-depth: 0
112118
- name: Prepare release
113119
uses: getsentry/action-prepare-release@v1
114120
env:
115-
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
121+
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
116122
with:
117123
version: ${{ github.event.inputs.version }}
118124
force: ${{ github.event.inputs.force }}
@@ -132,11 +138,16 @@ Here's [an example PR] and the [follow-up to fix `fetch-depth`].
132138
Give the following teams access to your repository:
133139

134140
- `engineering` -> `write`
135-
- `release-bot` -> `elevated bot`
136141

137142
You can do this self-service via the settings page of your repository:
138143
`https://github.com/getsentry/REPONAME_HERE/settings/access`
139144

145+
## Create Ruleset for the Repo
146+
147+
Download and save the [default ruleset template](/json/Default_ruleset.json) as a JSON file.
148+
149+
Visit the ruleset setting page of your repository: `https://github.com/getsentry/REPONAME_HERE/settings/rules`, click on the green **New ruleset** button, choose **Import a ruleset**, and select the JSON file you just downloaded. You can tweak the ruleset settings, but please don't remove the App in the Bypass List.
150+
140151
## Making Your First Release!
141152

142153
Navigate to the actions tab of your repository, locate the release workflow,

public/json/Default_ruleset.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "Default",
3+
"target": "branch",
4+
"source_type": "Repository",
5+
"enforcement": "active",
6+
"conditions": {
7+
"ref_name": {
8+
"exclude": [],
9+
"include": [
10+
"~DEFAULT_BRANCH"
11+
]
12+
}
13+
},
14+
"rules": [
15+
{
16+
"type": "pull_request",
17+
"parameters": {
18+
"required_approving_review_count": 1,
19+
"dismiss_stale_reviews_on_push": false,
20+
"require_code_owner_review": false,
21+
"require_last_push_approval": false,
22+
"required_review_thread_resolution": false,
23+
"automatic_copilot_code_review_enabled": false
24+
}
25+
},
26+
{
27+
"type": "deletion"
28+
},
29+
{
30+
"type": "non_fast_forward"
31+
}
32+
],
33+
"bypass_actors": [
34+
{
35+
"actor_id": 988504,
36+
"actor_type": "Integration",
37+
"bypass_mode": "always"
38+
},
39+
{
40+
"actor_id": 4687313,
41+
"actor_type": "Team",
42+
"bypass_mode": "always"
43+
}
44+
]
45+
}

0 commit comments

Comments
 (0)