Repository navigation
61 lines (51 loc) · 1.9 KB
/
Copy pathexport.yml
File metadata and controls
61 lines (51 loc) · 1.9 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
name: export
on:
schedule:
# Every 6 hours, offset from the top of the hour.
- cron: "13 */6 * * *"
workflow_dispatch:
permissions:
contents: write
concurrency:
group: export
cancel-in-progress: false
jobs:
export:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.2.0
with:
enable-cache: true
- name: Install dependencies
run: uv sync
- name: Run export
env:
GH_EXPORT_TOKEN: ${{ secrets.GH_EXPORT_TOKEN }}
GH_EXPORT_USER_TOKEN: ${{ secrets.GH_EXPORT_USER_TOKEN }}
run: uv run github-export export --config export.config.yaml
- name: Validate output
run: |
uv run github-export validate data/repos.public.json
uv run github-export validate data/repos.private.json
- name: Commit public export
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add data/repos.public.json
git diff --staged --quiet || git commit -m "chore(data): update repos.public.json"
git push
- name: Publish private export
if: vars.PRIVATE_DATA_REPO != ''
env:
GH_EXPORT_TOKEN: ${{ secrets.GH_EXPORT_TOKEN }}
PRIVATE_DATA_REPO: ${{ vars.PRIVATE_DATA_REPO }}
run: |
git clone "https://x-access-token:${GH_EXPORT_TOKEN}@github.com/${PRIVATE_DATA_REPO}.git" /tmp/private-data
cp data/repos.private.json /tmp/private-data/repos.private.json
cd /tmp/private-data
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add repos.private.json
git diff --staged --quiet || git commit -m "chore(data): update repos.private.json"
git push