Skip to content

PR Sentinel - Daily Check #22

PR Sentinel - Daily Check

PR Sentinel - Daily Check #22

name: PR Sentinel - Daily Check
on:
schedule:
- cron: "0 13 * * 1-5"
workflow_dispatch:
jobs:
run-pr-sentinel:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 22
- name: Install ts-node and TypeScript
run: |
npm install ts-node typescript
- name: Create .env file
uses: SpicyPizza/[email protected]
with:
envkey_AUTH_TOKEN: ${{ vars.AUTH_TOKEN }}
envkey_REPO_OWNER: ${{ vars.REPO_OWNER }}
envkey_REPO_NAME: ${{ vars.REPO_NAME }}
- name: Install dependencies
run: npm install
- name: Run PR Sentinel
run: npx tsx src/index.ts
- name: Convert CSV to Markdown Table
id: convert-csv
run: |
echo "| ๐Ÿ“‹ **PR Number** | ๐Ÿง‘โ€๐Ÿ’ป **Reviewer** | ๐Ÿ“… **Last Review Date** |" > table.md
echo "|------------------|------------------|------------------------|" >> table.md
tail -n +2 pr_reviewers.csv | while IFS=',' read -r pullNumber author lastReviewDate
do
prLink="[#$pullNumber](https://github.com/${{ vars.REPO_OWNER }}/${{ vars.REPO_NAME }}/pull/$pullNumber)"
echo "| $prLink | $author | $lastReviewDate |" >> table.md
done
shell: bash
- name: Get Current Date
id: current-date
run: echo "date=$(date '+%Y-%m-%d')" >> $GITHUB_ENV
- name: Create Issue From File
uses: peter-evans/[email protected]
with:
title: "PR Reviewers Report - ${{ env.date }}"
content-filepath: ./table.md