Commit b321a07
authored
fix(ci): authenticate tap push via org GitHub App, not a personal PAT (#28)
* fix(ci): authenticate tap push via org GitHub App, not a personal PAT
The homebrew-tap workflow pushes the generated formula to the separate
TechMatrix-labs/homebrew-pythinker repo, which the default GITHUB_TOKEN
cannot write to, so it used a personal PAT in HOMEBREW_TAP_TOKEN. That
PAT broke on the org migration and again on re-issue (authenticated but
lacked Contents: write -> 403 on push), freezing the tap at 0.25.0.
Replace it with a short-lived token minted at runtime from an org-owned
GitHub App (actions/create-github-app-token) that has Contents: Read and
write on the tap repo. The App is owned by the org (survives member/org
changes), its installation token expires in ~1h and is minted fresh each
run, and owner/repositories scope it to only the tap repo. Deploy keys —
the simpler robust option — are disabled org-wide, so the App is the
frictionless path that needs no org policy change.
Requires two secrets on this repo: HOMEBREW_TAP_APP_ID and
HOMEBREW_TAP_APP_PRIVATE_KEY. The old HOMEBREW_TAP_TOKEN secret is no
longer referenced and can be deleted.
* fix(ci): pin create-github-app-token to a commit SHA
This action mints an installation token from the tap App's private key,
so pin it to an immutable commit (v2.2.2) rather than the movable v2 tag
to remove the supply-chain risk of a retagged release exfiltrating the
key. Addresses CodeRabbit review on #28.1 parent 707817d commit b321a07
1 file changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
73 | 88 | | |
74 | 89 | | |
75 | 90 | | |
76 | | - | |
| 91 | + | |
77 | 92 | | |
78 | 93 | | |
79 | 94 | | |
80 | | - | |
| 95 | + | |
81 | 96 | | |
82 | 97 | | |
83 | 98 | | |
| |||
0 commit comments