-
-
Notifications
You must be signed in to change notification settings - Fork 20
87 lines (74 loc) · 3.27 KB
/
sync-chatgpt-auto-talk-changes.yml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Sync chatgpt/chatgpt-auto-talk/ to adamlui/chatgpt-auto-talk/greasemonkey/ & adamlui/ai-apps/chatgpt-auto-talk/greasemonkey/
on:
push:
branches: [master]
paths: [chatgpt/chatgpt-auto-talk/**]
jobs:
build:
if: (github.repository == 'adamlui/userscripts') && (github.event.commits[0].committer.username != 'kudo-sync-bot')
runs-on: ubuntu-latest
env:
TZ: PST8PDT
steps:
- name: Checkout adamlui/userscripts
uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_SYNC_PAT }}
repository: adamlui/userscripts
path: adamlui/userscripts
- name: Checkout adamlui/chatgpt-auto-talk
uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_SYNC_PAT }}
repository: adamlui/chatgpt-auto-talk
path: adamlui/chatgpt-auto-talk
- name: Checkout adamlui/ai-apps
uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_SYNC_PAT }}
repository: adamlui/ai-apps
path: adamlui/ai-apps
- name: Sync docs/ to adamlui/chatgpt-auto-talk/docs/ && adamlui/ai-apps/chatgpt-auto-talk/docs/
run: |
cp -r -f -v \
${{ github.workspace }}/adamlui/userscripts/chatgpt/chatgpt-auto-talk/docs \
${{ github.workspace }}/adamlui/chatgpt-auto-talk/
cp -r -f -v \
${{ github.workspace }}/adamlui/userscripts/chatgpt/chatgpt-auto-talk/docs \
${{ github.workspace }}/adamlui/ai-apps/chatgpt-auto-talk/
- name: Sync chatgpt/chatgpt-auto-talk/ to adamlui/chatgpt-auto-talk/greasemonkey/
run: |
rsync -avhr --delete \
${{ github.workspace }}/adamlui/userscripts/chatgpt/chatgpt-auto-talk/ \
${{ github.workspace }}/adamlui/chatgpt-auto-talk/greasemonkey/
- name: Sync chatgpt/chatgpt-auto-talk/ to adamlui/ai-apps/chatgpt-auto-talk/greasemonkey/
run: |
rsync -avhr --delete \
${{ github.workspace }}/adamlui/userscripts/chatgpt/chatgpt-auto-talk/ \
${{ github.workspace }}/adamlui/ai-apps/chatgpt-auto-talk/greasemonkey/
- name: Escape backticks in commit msg
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
echo "ESCAPED_MSG<<EOF" >> $GITHUB_ENV
echo "$COMMIT_MSG" | sed 's/`/\`/g' >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Config committer
run: |
gpg --batch --import <(echo "${{ secrets.GPG_PRIVATE_KEY }}")
git config --global commit.gpgsign true
git config --global user.name "kudo-sync-bot"
git config --global user.email "auto-sync@kudoai.com"
git config --global user.signingkey "${{ secrets.GPG_PRIVATE_ID }}"
- name: Push changes to adamlui/chatgpt-auto-talk
run: |
cd ${{ github.workspace }}/adamlui/chatgpt-auto-talk
git add .
git commit -n -m "$ESCAPED_MSG ↞ [auto-sync from \`adamlui/userscripts\`]" || true
git push
- name: Push changes to adamlui/ai-apps
run: |
cd ${{ github.workspace }}/adamlui/ai-apps
git add .
git commit -n -m "$ESCAPED_MSG ↞ [auto-sync from \`adamlui/userscripts/chatgpt/chatgpt-auto-talk\`]" || true
git push