Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(ci): close stale-bot gaps for re-marking and active-PR auto-close (#60402)

Julian Bezd9f6faa59768
diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml
index 67972af00776..81631b6691a7 100644
--- a/.github/workflows/stale.yaml
+++ b/.github/workflows/stale.yaml
@@ -5,8 +5,6 @@ on:
permissions:
contents: read
- issues: write
- pull-requests: write
jobs:
stale:
@@ -26,9 +24,22 @@ jobs:
echo "skip=false" >> $GITHUB_OUTPUT
fi
+ # App token gives higher API rate limits (15k/hr vs 1k/hr for GITHUB_TOKEN)
+ # and lets a full cycle through every open issue + PR complete in one run,
+ # which is required for the action's state model to re-evaluate PRs that
+ # were unstaled mid-cycle.
+ - name: Get app token
+ id: app-token
+ if: steps.holiday.outputs.skip != 'true'
+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
+ with:
+ client-id: ${{ secrets.GH_APP_POSTHOG_SCHEDULED_ACTIONS_APP_ID }}
+ private-key: ${{ secrets.GH_APP_POSTHOG_SCHEDULED_ACTIONS_PRIVATE_KEY }}
+
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
if: steps.holiday.outputs.skip != 'true'
with:
+ repo-token: ${{ steps.app-token.outputs.token }}
days-before-issue-stale: 730
days-before-issue-close: 14
stale-issue-message: "This issue hasn't seen activity in two years! If you want to keep it open, please remove the `stale` label – otherwise this will be closed in two weeks."
@@ -40,7 +51,7 @@ jobs:
stale-pr-message: "This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, please remove the `stale` label – otherwise this will be closed in another week. If you want to permanently keep it open, use the `waiting` label."
close-pr-message: "This PR was closed due to lack of activity. Feel free to reopen if it's still relevant."
stale-pr-label: stale
- remove-pr-stale-when-updated: false
+ remove-pr-stale-when-updated: true
exempt-pr-labels: 'waiting'
enable-statistics: true
- operations-per-run: 250
+ operations-per-run: 5000