-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (47 loc) · 1.39 KB
/
sync.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
name: Sync upstream branch
on:
schedule:
- cron: '14 6 * * *'
workflow_dispatch:
inputs:
cmd:
type: string
description: 'Custom commands'
required: false
default: ''
# permissions:
# contents: write
concurrency:
group: "sync"
cancel-in-progress: false
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout
# uses: actions/checkout@v4
# with:
# ref: upstream
# ${{ secrets.PAT }}: akku's personal token
run: |
cat > /tmp/key.private << EOL
${{ secrets.SYNC_PRIVATE_KEY }}
EOL
chmod 600 /tmp/key.private
git clone --depth=1 -b upstream \
-c "core.sshCommand=ssh -i /tmp/key.private -F /dev/null" \
'git@github.com:${{ github.repository }}' .
- name: Custom commands
if: ${{ inputs.cmd != '' }}
run: ${{ inputs.cmd }}
# ex: git fetch --depth=10 && git reset --hard 31e00b2fafa14a310fef63008e2e99dad97eb1d3 && git push -f
- name: Git
run: |
set -x
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote add up https://github.com/evex-dev/scratch-gui-vite.git
# git switch -c upstream
git pull up develop
git push -u origin upstream
git push