-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (49 loc) · 1.43 KB
/
sync-permissions.yml
File metadata and controls
60 lines (49 loc) · 1.43 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
# ================================
# GitHub Actions: Sync Permissions
# ================================
# Automatically syncs permissions.yaml to Redis on changes
name: Sync Permissions to Redis
on:
push:
paths:
- 'permissions.yaml'
branches:
- main
- master
# Allow manual trigger
workflow_dispatch:
jobs:
sync:
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 dependencies
run: npm ci
- name: Validate permissions.yaml
run: |
echo "Validating permissions.yaml..."
node -e "
const { validatePermissionsFile } = require('./src/services/syncService');
const result = validatePermissionsFile();
if (!result.valid) {
console.error('Validation failed:', result.errors);
process.exit(1);
}
console.log('Validation passed!');
"
- name: Sync to Redis
run: npm run sync-permissions
env:
REDIS_URL: ${{ secrets.REDIS_URL }}
- name: Notify on success
if: success()
run: echo "✅ Permissions synced successfully!"
- name: Notify on failure
if: failure()
run: echo "❌ Permissions sync failed!"