diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml new file mode 100644 index 0000000..3f4cd48 --- /dev/null +++ b/.github/workflows/pr-checks.yml @@ -0,0 +1,29 @@ +name: PR Checks + +on: + pull_request: + branches: [main] + +jobs: + lint-and-format: + name: Lint & Format Check + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: ESLint validation + run: npm run lint + + - name: TypeScript type checking + run: npm run type-check \ No newline at end of file diff --git a/.github/workflows/summary.yml b/.github/workflows/summary.yml new file mode 100644 index 0000000..400785d --- /dev/null +++ b/.github/workflows/summary.yml @@ -0,0 +1,31 @@ +name: Summarize new issues + +on: + issues: + types: [opened] # Triggers when new issues are created + +jobs: + summary: + runs-on: ubuntu-latest + permissions: + issues: write # Can comment on issues + models: read # For future AI integration + contents: read # Can read repository content + + steps: + - name: Checkout repository + uses: actions/checkout@v4 # Gets repository code + + - name: Create issue summary + id: summary + run: | + # Creates a simple automated summary + SUMMARY="**Issue Summary:** This issue has been automatically categorized and will be reviewed by the maintainers. Title: ${{ github.event.issue.title }}" + echo "summary=${SUMMARY}" >> $GITHUB_OUTPUT # Sets output for next step + + - name: Comment with summary + run: | + gh issue comment $ISSUE_NUMBER --body "${{ steps.summary.outputs.summary }}" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Built-in GitHub token + ISSUE_NUMBER: ${{ github.event.issue.number }} \ No newline at end of file diff --git a/package.json b/package.json index d29abda..662d41a 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "type-check": "tsc --noEmit" }, "dependencies": { "@auth/core": "^0.37.0",