-
Notifications
You must be signed in to change notification settings - Fork 145
62 lines (56 loc) · 2.91 KB
/
sync-chatgpt.js-changes-to-chrome-starter.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
name: Sync chatgpt.js to (/starters/chrome && KudoAI/chatgpt.js-chrome-starter)/extension/lib/chatgpt.js
on:
push:
branches: [master, main]
paths: [chatgpt.js]
jobs:
build:
if: (github.repository == 'KudoAI/chatgpt.js') && (github.event.commits[0].committer.username != 'kudo-sync-bot')
runs-on: ubuntu-latest
steps:
- name: Checkout KudoAI/chatgpt.js
uses: actions/checkout@v2
with:
token: ${{ secrets.REPO_SYNC_PAT }}
repository: KudoAI/chatgpt.js
path: KudoAI/chatgpt.js
- name: Checkout KudoAI/chatgpt.js-chrome-starter
uses: actions/checkout@v2
with:
token: ${{ secrets.REPO_SYNC_PAT }}
repository: KudoAI/chatgpt.js-chrome-starter
path: KudoAI/chatgpt.js-chrome-starter
- name: Sync chatgpt.js to /starters/chrome/extension/lib/chatgpt.js + update version in manifest.json
run: |
cp -f \
"${{ github.workspace }}/KudoAI/chatgpt.js/chatgpt.js" \
"${{ github.workspace }}/KudoAI/chatgpt.js/starters/chrome/extension/lib/chatgpt.js"
echo "export { chatgpt };" >> "${{ github.workspace }}/KudoAI/chatgpt.js/starters/chrome/extension/lib/chatgpt.js"
cd "${{ github.workspace }}/KudoAI/chatgpt.js/starters/chrome/extension"
sed -i -E "s/\"version\": \"([0-9]+\.[0-9]+\.[0-9]+)\.*([0-9]*)\"/\"version\": \"$(date +'%Y.%-m.%-d')\"/g" manifest.json
- name: Sync chatgpt.js to KudoAI/chatgpt.js-chrome-starter/extension/lib/chatgpt.js + update version in manifest.json
run: |
cp -f \
"${{ github.workspace }}/KudoAI/chatgpt.js/chatgpt.js" \
"${{ github.workspace }}/KudoAI/chatgpt.js-chrome-starter/extension/lib/chatgpt.js"
echo "export { chatgpt };" >> "${{ github.workspace }}/KudoAI/chatgpt.js-chrome-starter/extension/lib/chatgpt.js"
cd "${{ github.workspace }}/KudoAI/chatgpt.js-chrome-starter/extension"
sed -i -E "s/\"version\": \"([0-9]+\.[0-9]+\.[0-9]+)\.*([0-9]*)\"/\"version\": \"$(date +'%Y.%-m.%-d')\"/g" manifest.json
- name: Push to KudoAI/chatgpt.js
uses: stefanzweifel/git-auto-commit-action@v4
with:
push_options: --force
add_options: --all
commit_user_email: [email protected]
commit_message: "${{ github.event.head_commit.message }} ↞ [auto-sync from `KudoAI/chatgpt.js`]"
file_pattern: "starters/chrome/extension/**"
repository: KudoAI/chatgpt.js
- name: Push to KudoAI/chatgpt.js-chrome-starter
uses: stefanzweifel/git-auto-commit-action@v4
with:
push_options: --force
add_options: --all
commit_user_email: [email protected]
commit_message: "${{ github.event.head_commit.message }} ↞ [auto-sync from `KudoAI/chatgpt.js`]"
file_pattern: "extension/**"
repository: KudoAI/chatgpt.js-chrome-starter