-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpr-analysis.yml
More file actions
66 lines (55 loc) · 2.07 KB
/
Copy pathpr-analysis.yml
File metadata and controls
66 lines (55 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Weekly PR Analysis
on:
# Run every Monday at 9 AM UTC
schedule:
- cron: '0 9 * * 1'
# Allow manual triggering
workflow_dispatch:
inputs:
repository:
description: 'Repository to analyze (owner/repo)'
required: false
default: 'github/copilot-sdk'
jobs:
analyze-prs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install GitHub CLI
run: |
type -p curl >/dev/null || sudo apt install curl -y
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh -y
- name: Install Copilot CLI
run: |
gh extension install github/gh-copilot || true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: npm ci
- name: Run PR analysis
run: |
REPO="${{ github.event.inputs.repository || 'github/copilot-sdk' }}"
npm start -- --repo "$REPO" --non-interactive --output ./output
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload analysis results
uses: actions/upload-artifact@v4
with:
name: pr-analysis-report-${{ github.run_number }}
path: output/
retention-days: 30
- name: Comment on issue (optional)
if: github.event_name == 'workflow_dispatch'
run: |
echo "Analysis complete! Check the artifacts for detailed reports."
# You can extend this to post results to an issue or PR