Skip to content

Commit

Permalink
Merge pull request #16 from google/ojarjur/pr-mirror
Browse files Browse the repository at this point in the history
Use a github workflow to mirror pull requets into git-notes
  • Loading branch information
ojarjur authored Apr 4, 2020
2 parents a26efb9 + 0291568 commit fa52a4f
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/mirror-pull-requests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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 git-appraise and the pr mirror
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 '+refs/heads/*:refs/heads/*'
git fetch origin '+refs/tags/*:refs/tags/*'
git fetch origin '+refs/pull/*:refs/pull/*'
- 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

0 comments on commit fa52a4f

Please sign in to comment.