Repository navigation
ci(repo): mint the release token from the GitHub App #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,9 +12,25 @@ jobs: | |
| release-please: | ||
| if: github.repository == 'sentdm/sent-dm-ruby' | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| HAS_APP: ${{ secrets.SDK_APP_ID != '' && secrets.SDK_APP_PRIVATE_KEY != '' }} | ||
|
|
||
| steps: | ||
| - name: Mint the release token from the GitHub App | ||
| # A tag or release created with the built-in token starts no | ||
| # workflow, so the publish workflow would never run; a personal | ||
| # access token expires or dies with its owner's account. The App's | ||
| # token does neither. | ||
| id: app | ||
| if: env.HAS_APP == 'true' | ||
| uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v3.3.0 | ||
| with: | ||
| app-id: ${{ secrets.SDK_APP_ID }} | ||
| private-key: ${{ secrets.SDK_APP_PRIVATE_KEY }} | ||
| owner: sentdm | ||
| repositories: ${{ github.event.repository.name }} | ||
|
|
||
|
Comment on lines
+24
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 (optional) If the App is not installed on sent-dm-ruby with contents and pull-requests write, the release job now fails and still cuts no release. The step mints a token for Why this was flaggedTrigger condition (not verifiable from this checkout): the Verification: Line 16 sets |
||
| - uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4.4.1 | ||
| id: release | ||
| with: | ||
| token: ${{ secrets.RELEASE_PLEASE_TOKEN }} | ||
| token: ${{ steps.app.outputs.token || secrets.RELEASE_PLEASE_TOKEN }} | ||
|
Comment on lines
+15
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Every SDK's release can be blocked when the generator next regenerates this release workflow, which this PR edits by hand. Release Please may also go back to the revoked PAT. release-please.yml is generator-owned per CLAUDE.md, and this hand-written commit has no Stainless-Generated-From trailer. It also changes the generator-written Why this was flaggedThe workflow at .github/workflows/release-please.yml is on CLAUDE.md's list of generator-owned files: "the publish, release and sync workflows ... The next generated commit rewrites them, and an edit conflicts." Commit 1949b43 is hand-written with no Stainless-Generated-From trailer. It adds the env/step block at lines 15-32 and rewrites the generator-emitted line Verification: It is triggered by the next generated commit that touches the release workflow. Commit 1949b43 has no Stainless-Generated-From trailer. It also rewrites an existing line at .github/workflows/release-please.yml:36. If the generator overwrites the file, :36 goes back to
Comment on lines
+24
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟣 pre-existing, not blocking: Maintainers can still get the same "Bad credentials" failure and no release whenever the App secrets are missing. The job falls back to a token that no longer exists. When Why this was flaggedThe trigger is any push to main where Verification: pre-existing. Trigger: |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 The PR description and commit message break the public-repo rule by naming an internal repository and tracker. They name
sent-dm-sdk-pipelineand say "Part of EPIC-4427". CLAUDE.md: "This repository is public. Nothing in it, including PR text, CHANGELOG.md and release notes, links to or names Sent's private repositories, internal systems or providers." The commit body is also kept permanently in public history. Fix: before merging, reword the commit message and PR description so they say "the GitHub App" and drop the private repo name and the epic ID.Why this was flagged
Commit 1949b43's message says "The token now comes from the sent-dm-sdk-pipeline App", and sentdm/sent-dm-sdk-pipeline is the private config repo (see CONFIG_REPO in .github/workflows/seal-dispatch.yml). The PR description repeats that name and adds the internal tracker ID EPIC-4427. CLAUDE.md's Commits and pull requests section forbids naming private repositories or internal systems anywhere in the public repo, PR text included. REVIEW.md lists this as Important. Once the PR merges, the commit message is part of public history on main and can no longer be removed without rewriting history. The diff lines themselves only use the secret names and
owner: sentdm, so the leak is in the commit and PR text, not in the workflow code.Verification: nit. Trigger: the PR merges with its current commit message and description. Commit 1949b43's body says "The token now comes from the sent-dm-sdk-pipeline App". The PR description repeats that name and adds "Part of EPIC-4427", which is an internal tracker ID. The same repo name is already committed in the public base, at seal-dispatch.yml lines 37 and 48.