-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (43 loc) · 1.31 KB
/
ProxySU.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
name: ProxySU
on:
schedule:
- cron: '33 9 * * *'
workflow_dispatch:
repository_dispatch:
types: sync-ProxySU
jobs:
repo-sync:
env:
PAT: ${{ secrets.PAT }}
runs-on: ubuntu-latest
if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Checkout the repository
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Check if branch exists
id: check_branch
run: |
if git show-ref --verify --quiet refs/heads/ProxySU; then
echo "branch_exists=true" >> $GITHUB_ENV
else:
echo "branch_exists=false" >> $GITHUB_ENV
fi
- name: Delete existing branch
if: ${{ env.branch_exists == 'true' }}
run: |
git push origin --delete ProxySU
- name: Create new branch
if: ${{ env.branch_exists == 'false' }}
run: |
git checkout -b ProxySU
git push --set-upstream origin ProxySU
- name: Sync branch
uses: repo-sync/github-sync@v2
if: env.PAT
with:
source_repo: "https://github.com/proxysu/ProxySU"
source_branch: "master"
destination_branch: "ProxySU"
github_token: ${{ secrets.PAT }}