forked from PipedreamHQ/pipedream
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscheduled-package-validation.yaml
More file actions
93 lines (80 loc) · 3.2 KB
/
Copy pathscheduled-package-validation.yaml
File metadata and controls
93 lines (80 loc) · 3.2 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Scheduled Package Validation Report
on:
schedule:
# Run weekly on Mondays at 2:00 PM UTC
- cron: '0 14 * * 1'
workflow_dispatch: # Allow manual triggering for testing
jobs:
validate-packages:
name: Generate Package Validation Report
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v5.0.0
with:
version: 10.28.2
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Compile TypeScript
run: pnpm run build
- name: Run Package Validation Report
id: validation
run: |
node scripts/generate-package-report.js --verbose --report-only --output=validation-report.json > validation-report.txt 2>&1
echo "validation_exit_code=$?" >> $GITHUB_OUTPUT
continue-on-error: true
- name: Upload Validation Report
uses: actions/upload-artifact@v7
with:
name: package-validation-report-${{ github.run_number }}
path: |
validation-report.txt
validation-report.json
retention-days: 30
- name: Check for failures
id: check_failures
run: |
if [ -f "validation-report.json" ]; then
FAILED_COUNT=$(node -e "
const fs = require('fs');
try {
const report = JSON.parse(fs.readFileSync('validation-report.json', 'utf8'));
console.log(report.summary.failed || 0);
} catch {
console.log(0);
}
")
echo "failed_count=$FAILED_COUNT" >> $GITHUB_OUTPUT
else
echo "failed_count=0" >> $GITHUB_OUTPUT
fi
- name: Create Issue on Failures
if: steps.check_failures.outputs.failed_count != '0'
id: create_issue
uses: ./.github/actions/create-package-validation-issue
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
validation-report-json: 'validation-report.json'
validation-report-txt: 'validation-report.txt'
workflow-run-number: ${{ github.run_number }}
workflow-run-id: ${{ github.run_id }}
server-url: ${{ github.server_url }}
repository: ${{ github.repository }}
- name: Post Issue Summary
if: steps.create_issue.conclusion == 'success' && steps.create_issue.outputs.issue-url != ''
run: |
echo "📋 Issue created/updated: ${{ steps.create_issue.outputs.issue-url }}"
echo "❌ Failed packages: ${{ steps.create_issue.outputs.failed-count }}"
echo "🔄 Issue was ${{ steps.create_issue.outputs.issue-created == 'true' && 'created' || 'updated' }}"
- name: Post Success Summary
if: steps.check_failures.outputs.failed_count == '0'
run: |
echo "🎉 All packages validated successfully!"
echo "Scheduled validation completed with no issues."