Skip to content

Commit b7dee0b

Browse files
zackeesclaude
andcommitted
ci(project): switch auto-add-to-project to GitHub App auth
Replaces the PAT-based token with a token minted from the FastLED Project Sync GitHub App (ID 3422407). Installation tokens rotate automatically and scope is narrow (Projects read/write only). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0c59082 commit b7dee0b

1 file changed

Lines changed: 27 additions & 11 deletions

File tree

.github/workflows/add-to-project.yml

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,21 @@ name: add-to-project
22

33
# Auto-adds every new issue / PR to the FastLED Tracker project (#1).
44
#
5-
# This is a minimal fallback sync — the repo also has `project_automation.yml`
6-
# which handles auto-add PLUS Status field transitions, but that one is gated
7-
# on a GitHub App being configured (PROJECT_APP_ID / PROJECT_APP_PRIVATE_KEY).
8-
# Until the App is wired up, this file covers the auto-add behavior using a
9-
# PAT stored in `secrets.ADD_TO_PROJECT_PAT`.
5+
# Auth: GitHub App "FastLED Project Sync" — scoped to Projects: read/write +
6+
# Contents/Issues/Pull requests: read. No expiration (App installation tokens
7+
# auto-rotate). The App ID lives in a repo variable; the private key lives in
8+
# a repo secret.
109
#
11-
# The PAT needs `project` and `repo` scopes. Rotate via:
12-
# gh secret set ADD_TO_PROJECT_PAT --repo FastLED/FastLED --body "<new-pat>"
10+
# Required configuration (already set on all 6 feeder repos):
11+
# vars.PROJECT_APP_ID = 3422407
12+
# vars.PROJECT_OWNER = FastLED
13+
# vars.PROJECT_NUMBER = 1
14+
# secrets.PROJECT_APP_PRIVATE_KEY = <PEM contents>
15+
#
16+
# To rotate the App's private key:
17+
# 1. On https://github.com/organizations/FastLED/settings/apps generate new key
18+
# 2. For each repo: gh secret set PROJECT_APP_PRIVATE_KEY --repo FastLED/<repo> < new.pem
19+
# 3. Revoke the old key in the App settings
1320

1421
on:
1522
issues:
@@ -23,9 +30,18 @@ permissions:
2330
jobs:
2431
add:
2532
runs-on: ubuntu-latest
26-
if: ${{ github.event.sender.type != 'Bot' || true }}
33+
if: ${{ vars.PROJECT_APP_ID != '' && vars.PROJECT_OWNER != '' }}
2734
steps:
28-
- uses: actions/add-to-project@v1.0.2
35+
- name: Generate App token
36+
id: app-token
37+
uses: actions/create-github-app-token@v1
38+
with:
39+
app-id: ${{ vars.PROJECT_APP_ID }}
40+
private-key: ${{ secrets.PROJECT_APP_PRIVATE_KEY }}
41+
owner: ${{ vars.PROJECT_OWNER }}
42+
43+
- name: Add to project
44+
uses: actions/add-to-project@v1.0.2
2945
with:
30-
project-url: https://github.com/orgs/FastLED/projects/1
31-
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
46+
project-url: https://github.com/orgs/${{ vars.PROJECT_OWNER }}/projects/${{ vars.PROJECT_NUMBER }}
47+
github-token: ${{ steps.app-token.outputs.token }}

0 commit comments

Comments
 (0)