Skip to content

Commit 0c81fb8

Browse files
committed
Add manual trigger to sync workflow for testing
1 parent f21710b commit 0c81fb8

2 files changed

Lines changed: 43 additions & 1 deletion

File tree

.github/workflows/sync.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Sync folders to dplava/vt
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- feature/xml-output-test
8+
workflow_dispatch:
9+
10+
jobs:
11+
sync-folders:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout source repo
15+
uses: actions/checkout@v4
16+
17+
- name: Prepare temp directory with only folders (no .sh, .py, or root files)
18+
run: |
19+
mkdir temp-sync
20+
shopt -s dotglob
21+
for d in */ ; do
22+
if [ -d "$d" ] && [[ "$d" != ".git/" && "$d" != ".github/" ]]; then
23+
mkdir -p "temp-sync/$d"
24+
rsync -av --exclude='*.sh' --exclude='*.py' --exclude='*.*' --prune-empty-dirs "$d" "temp-sync/"
25+
fi
26+
done
27+
28+
- name: Push to target repo (overwrite target folders)
29+
env:
30+
TOKEN: ${{ secrets.synctokendplava }}
31+
run: |
32+
cd temp-sync
33+
git init
34+
git config user.email "github-actions[bot]@users.noreply.github.com"
35+
git config user.name "github-actions[bot]"
36+
git add .
37+
git commit -m "Sync folders from dlp-dpla-xml-export (folders only, no .sh, .py, or root files)"
38+
git branch -M main
39+
git remote add target https://x-access-token:${TOKEN}@github.com/dplava/vt.git
40+
git push --force target main:main

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,6 @@ logs/
5050
*.csv
5151
update_archive_dates_from_csv.py
5252
dynamodb_column_uniques.py
53-
.github/
53+
.github/*
54+
!.github/workflows/
55+
unique_medium_values_cleaned.txt

0 commit comments

Comments
 (0)