diff --git a/.github/workflows/slack-open-prs-notification.yml b/.github/workflows/slack-open-prs-notification.yml new file mode 100644 index 00000000..41ed4523 --- /dev/null +++ b/.github/workflows/slack-open-prs-notification.yml @@ -0,0 +1,51 @@ +name: Slack Open PRs Notification + +on: + schedule: + - cron: '0 13 * * *' # 8:00 AM EST (13:00 UTC) + workflow_dispatch: + +permissions: + pull-requests: read + +jobs: + notify-slack: + runs-on: ubuntu-latest + steps: + - name: Get open PRs + id: open-prs + uses: actions/github-script@v7 + with: + script: | + const { data: prs } = await github.rest.pulls.list({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + }); + + const count = prs.length; + + // Format each PR with plain text and bare URL (Slack auto-links URLs) + const prList = prs.map(pr => + `• #${pr.number} - ${pr.title} (by ${pr.user.login})\n ${pr.html_url}` + ).join('\n'); + + core.setOutput('count', count); + + // Use GITHUB_OUTPUT delimiter for multiline support + const fs = require('fs'); + fs.appendFileSync( + process.env.GITHUB_OUTPUT, + `pr_list<