-
-
Notifications
You must be signed in to change notification settings - Fork 79
40 lines (34 loc) · 1.15 KB
/
Copy pathsync-scripts.yml
File metadata and controls
40 lines (34 loc) · 1.15 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
name: Sync Scripts Repository
on:
push:
branches: [master]
paths:
- 'p3/scripts/**'
workflow_dispatch:
jobs:
sync-to-psygreg:
runs-on: ubuntu-latest
steps:
- name: Checkout main repository
uses: actions/checkout@v4
- name: Clone psygreg/scripts repository
uses: actions/checkout@v4
with:
repository: psygreg/scripts
path: sync-target
token: ${{ secrets.SCR_TOKEN }}
- name: Sync files from local scripts to remote repository
run: |
find ./sync-target -mindepth 1 -maxdepth 1 \
! -name '.git' \
! -name 'LICENSE' \
! -name 'README.md' \
-exec rm -rf {} +
cp -r ./p3/scripts/* ./sync-target/ || true
- name: Commit and push changes
working-directory: ./sync-target
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git diff --quiet && git diff --staged --quiet || (git commit -m "chore: sync scripts from linuxtoys" && git push)