Skip to content

Commit f3badf9

Browse files
committed
fix: use Art Board Bot GitHub app instead of PAT, add permissions
Switch from PROJECT_PAT to the new PostHog Art Board Bot app (GH_APP_POSTHOG_ART_BOARD_BOT_APP_ID / PRIVATE_KEY) using actions/create-github-app-token. Add permissions block to all three workflows to satisfy security checks.
1 parent 81ee964 commit f3badf9

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

.github/workflows/art-board-reminder.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Art board project reminder (reusable)
33
# Reusable workflow: paginates a Projects V2 board, finds issues stuck in a
44
# given column for too long, and posts a one-time reminder comment.
55

6+
permissions:
7+
contents: read
8+
69
on:
710
workflow_call:
811
inputs:
@@ -26,13 +29,21 @@ on:
2629
required: true
2730
type: string
2831
secrets:
29-
PROJECT_PAT:
32+
GH_APP_POSTHOG_ART_BOARD_BOT_APP_ID:
33+
required: true
34+
GH_APP_POSTHOG_ART_BOARD_BOT_PRIVATE_KEY:
3035
required: true
3136

3237
jobs:
3338
remind:
3439
runs-on: ubuntu-latest
3540
steps:
41+
- name: Get app token
42+
id: app-token
43+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
44+
with:
45+
app-id: ${{ secrets.GH_APP_POSTHOG_ART_BOARD_BOT_APP_ID }}
46+
private-key: ${{ secrets.GH_APP_POSTHOG_ART_BOARD_BOT_PRIVATE_KEY }}
3647
- name: Find stale issues and post reminders
3748
uses: actions/github-script@v7
3849
env:
@@ -42,7 +53,7 @@ jobs:
4253
INPUT_TAG: ${{ inputs.reminder_tag }}
4354
INPUT_MESSAGE: ${{ inputs.message }}
4455
with:
45-
github-token: ${{ secrets.PROJECT_PAT }}
56+
github-token: ${{ steps.app-token.outputs.token }}
4657
script: |
4758
const column = process.env.INPUT_COLUMN;
4859
const staleDays = parseInt(process.env.INPUT_STALE_DAYS);

.github/workflows/art-board-reminders.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Art board reminders
22

3+
permissions:
4+
contents: read
5+
36
on:
47
schedule:
58
- cron: '0 9 * * *' # daily 9 AM UTC
@@ -14,7 +17,8 @@ jobs:
1417
reminder_tag: '<!-- art-board-feedback-reminder -->'
1518
message: 'This issue has been in **Feedback/Review** for {days} days. Any feedback needed to move it forward?'
1619
secrets:
17-
PROJECT_PAT: ${{ secrets.PROJECT_PAT }}
20+
GH_APP_POSTHOG_ART_BOARD_BOT_APP_ID: ${{ secrets.GH_APP_POSTHOG_ART_BOARD_BOT_APP_ID }}
21+
GH_APP_POSTHOG_ART_BOARD_BOT_PRIVATE_KEY: ${{ secrets.GH_APP_POSTHOG_ART_BOARD_BOT_PRIVATE_KEY }}
1822

1923
no-status:
2024
uses: ./.github/workflows/art-board-reminder.yml
@@ -25,4 +29,5 @@ jobs:
2529
reminder_tag: '<!-- art-board-no-status-reminder -->'
2630
message: 'This issue has been sitting without an owner for {days} days. Can someone pick this up or assign it to a column on the board?'
2731
secrets:
28-
PROJECT_PAT: ${{ secrets.PROJECT_PAT }}
32+
GH_APP_POSTHOG_ART_BOARD_BOT_APP_ID: ${{ secrets.GH_APP_POSTHOG_ART_BOARD_BOT_APP_ID }}
33+
GH_APP_POSTHOG_ART_BOARD_BOT_PRIVATE_KEY: ${{ secrets.GH_APP_POSTHOG_ART_BOARD_BOT_PRIVATE_KEY }}

.github/workflows/art-board-status-change.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ name: Art board status change
55
# 2. Moved to "Assigned: X" → remove the other default assignees
66
# (exception: internal requests from team members keep everyone assigned)
77

8+
permissions:
9+
contents: read
10+
811
on:
912
projects_v2_item:
1013
types: [edited]
@@ -14,10 +17,16 @@ jobs:
1417
runs-on: ubuntu-latest
1518
if: github.event.projects_v2_item.field_name == 'Status'
1619
steps:
20+
- name: Get app token
21+
id: app-token
22+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
23+
with:
24+
app-id: ${{ secrets.GH_APP_POSTHOG_ART_BOARD_BOT_APP_ID }}
25+
private-key: ${{ secrets.GH_APP_POSTHOG_ART_BOARD_BOT_PRIVATE_KEY }}
1726
- name: Close issue or sync assignees
1827
uses: actions/github-script@v7
1928
with:
20-
github-token: ${{ secrets.PROJECT_PAT }}
29+
github-token: ${{ steps.app-token.outputs.token }}
2130
script: |
2231
const ASSIGNEE_MAP = {
2332
'Assigned: Daniel': { keep: 'dphawkins1617', remove: ['lottiecoxon', 'heidiberton'] },

0 commit comments

Comments
 (0)