-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (51 loc) · 1.95 KB
/
Copy pathsync-data.yml
File metadata and controls
58 lines (51 loc) · 1.95 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
name: Data Sync
on:
schedule:
- cron: "0 0 * * 0" # Run weekly on Sunday at midnight UTC
workflow_dispatch: # Allow manual trigger
permissions:
contents: write # Needed to commit back to the repo
pull-requests: write # Needed to create pull request
jobs:
sync-projects:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: "20"
- name: Run GitHub Data Sync
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node scripts/sync-project-data.js
# Note: Reused BUMP_PRIVATE_GPG key for signing data sync commits
- name: Import GPG Key
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v7
with:
gpg_private_key: ${{ secrets.BUMP_PRIVATE_GPG }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8
with:
author: "${{ steps.import-gpg.outputs.name }} <${{ steps.import-gpg.outputs.email }}>"
committer: "${{ steps.import-gpg.outputs.name }} <${{ steps.import-gpg.outputs.email }}>"
commit-message: "chore(data): auto-sync github project metadata"
title: "chore(data): auto-sync github project metadata"
body: |
Automated weekly sync of GitHub project metadata in `data/projects.json`.
branch: chore/auto-sync-project-metadata
delete-branch: true
labels: |
data-sync
automation
- name: Enable Auto-Merge
if: steps.cpr.outputs.pull-request-operation != 'closed'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr merge --auto --squash "${{ steps.cpr.outputs.pull-request-number }}" || true