-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (60 loc) · 2.28 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Sync repo
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: casey/just
token: ${{ secrets.GITHUB_TOKEN }}
path: ./.sync-repo
ref: master
- name: Replace files
shell: bash
run: |
rm -rf ./.sync-repo/.git
rsync -av --exclude='.github/' ./.sync-repo/ .
rm -rf ./.sync-repo/
- name: Create PR
id: cpr
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: sync files from source repo"
committer: gnpaone <[email protected]>
author: gnpaone <[email protected]>
branch: sync-action
base: master
delete-branch: true
title: Sync source repo
labels: ":zap: pull"
# - name: Identify merge conflict
# if: steps.cpr.outputs.pull-request-operation == 'created'
# id: conf
# uses: codytseng/auto-comment-merge-conflicts@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# label-name: ":no_entry: merge-conflict"
# - name: Assign PR
# if: steps.conf.outputs.new-conflicting-prs && (Object.keys(steps.conf.outputs.new-conflicting-prs).length > 0) && (String(steps.cpr.outputs.pull-request-number) == String(steps.conf.outputs.new-conflicting-prs.number))
# uses: wow-actions/auto-assign@v3
# with:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# assignees: gnpaone
- name: Enable pull request automerge
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
- name: Delete PRs head branch
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: dawidd6/action-delete-branch@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
numbers: ${{ steps.cpr.outputs.pull-request-number }}