-
Notifications
You must be signed in to change notification settings - Fork 63
28 lines (26 loc) · 1.18 KB
/
sync-diff.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
name: sync-diff
on:
pull_request_target:
types:
- closed
branches:
- dev
jobs:
sync:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
repository: ByteLegend/quests
fetch-depth: 0
token: ${{ secrets.BYTELEGENDBOT_TOKEN }}
- name: Sync diff
run: >
mkdir -p challenges/GitIsland/git-commit-and-push/git-commit-and-push-challenge/diffs &&
curl -L https://github.com/${{ github.event.repository.full_name }}/pull/${{ github.event.pull_request.number }}.diff --output challenges/GitIsland/git-commit-and-push/git-commit-and-push-challenge/diffs/pr-${{ github.event.pull_request.number }}.diff &&
git config user.email [email protected] &&
git config user.name ByteLegendBot &&
git add challenges/GitIsland/git-commit-and-push/git-commit-and-push-challenge/diffs &&
git commit -m 'Sync diff from https://github.com/${{ github.event.repository.full_name }}/pull/${{ github.event.pull_request.number }}' &&
git push https://${{ secrets.BYTELEGENDBOT_TOKEN }}@github.com/ByteLegend/quests.git