Skip to content

Commit cd931ab

Browse files
abhizipstackclaude
andauthored
feat: add stale bot and release notification workflows (#42)
* feat: add stale bot and release notification workflows Stale bot: - Runs daily, marks issues/PRs as stale after 60 days of inactivity - Auto-closes after 7 more days if no activity - Exempts pinned, security, and bug labels - Uses existing 'stale' label (created in PR #15) Release notification: - Posts to Slack when a GitHub release is published - Requires SLACK_WEBHOOK_URL secret (skips if not configured) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address Greptile review — JSON injection, close-pr-message, exempt labels - Fix JSON injection in Slack payload — build message in run step to avoid malformed JSON from release names with quotes - Add close-pr-message for stale PRs — contributors get context - Add bug to exempt-pr-labels — match issue exemptions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: pass release event data via env to prevent script injection Use env variables instead of direct ${{ }} interpolation in run block to prevent shell injection from release names with metacharacters. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4600438 commit cd931ab

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release Notification
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
notify:
9+
runs-on: ubuntu-latest
10+
if: ${{ secrets.SLACK_WEBHOOK_URL != '' }}
11+
steps:
12+
- name: Build Slack message
13+
id: message
14+
env:
15+
TAG: ${{ github.event.release.tag_name }}
16+
RELEASE_NAME: ${{ github.event.release.name }}
17+
URL: ${{ github.event.release.html_url }}
18+
run: |
19+
echo "text=🚀 *Visitran ${TAG}* released! ${RELEASE_NAME} <${URL}|View Release Notes>" >> "$GITHUB_OUTPUT"
20+
21+
- name: Post to Slack
22+
uses: slackapi/slack-github-action@v2.1.0
23+
with:
24+
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
25+
webhook-type: incoming-webhook
26+
payload: |
27+
{
28+
"text": "${{ steps.message.outputs.text }}"
29+
}

.github/workflows/stale.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Stale Issues and PRs
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *" # Daily midnight UTC
6+
workflow_dispatch:
7+
8+
permissions:
9+
issues: write
10+
pull-requests: write
11+
12+
jobs:
13+
stale:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/stale@v9
17+
with:
18+
stale-issue-message: >
19+
This issue has been automatically marked as stale due to
20+
inactivity. It will be closed in 7 days if no further
21+
activity occurs. If this issue is still relevant, please
22+
comment to keep it open.
23+
stale-pr-message: >
24+
This pull request has been automatically marked as stale
25+
due to inactivity. It will be closed in 7 days if no
26+
further activity occurs.
27+
close-issue-message: >
28+
This issue was closed because it has been inactive for
29+
too long. Feel free to reopen if it is still relevant.
30+
close-pr-message: >
31+
This pull request was closed because it has been inactive
32+
for too long. Feel free to reopen if it is still relevant.
33+
stale-issue-label: "stale"
34+
stale-pr-label: "stale"
35+
days-before-stale: 60
36+
days-before-close: 7
37+
exempt-issue-labels: "pinned,security,bug"
38+
exempt-pr-labels: "pinned,security,bug"
39+
exempt-all-milestones: true

0 commit comments

Comments
 (0)