-
Notifications
You must be signed in to change notification settings - Fork 147
45 lines (37 loc) · 1.67 KB
/
mirror-pull-requests.yaml
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
name: Mirror pull requests into git-notes
on: [pull_request, issue_comment, pull_request_review, pull_request_review_comment, status]
jobs:
build:
name: Mirror
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
- name: Setup go modules
run: |
go get github.com/google/git-appraise/git-appraise
go get github.com/google/git-pull-request-mirror/batch
- name: Configure git for the PR mirror
run: |
git config --global user.email "${{ github.repository }}@github.com"
git config --global user.name "Pull Request Mirror"
- name: Fetch upstream refs
run: |
git fetch origin --unshallow
git fetch origin '+refs/heads/*:refs/remotes/origin/*'
git fetch origin '+refs/heads/master:refs/heads/master' || git pull
git fetch origin '+refs/tags/*:refs/tags/*'
git fetch origin '+refs/pull/*:refs/pull/*'
git fetch origin '+refs/devtools/*:refs/devtools/*'
- name: Pull existing reviews
run: go run github.com/google/git-appraise/git-appraise pull
- name: Mirror pull requests into local reviews
run: go run github.com/google/git-pull-request-mirror/batch --target '${{ github.repository }}' --local ./ --auth-token '${{ secrets.PR_MIRROR_TOKEN }}'
- name: Merge any upstream review changes
run: go run github.com/google/git-appraise/git-appraise pull
- name: Push updated reviews back upstream
run: go run github.com/google/git-appraise/git-appraise push