-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (32 loc) · 1.01 KB
/
main.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
name: Diff Sample
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
Diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
ref: ${{ github.ref }}
- name: Setup requirements
run: |
pip install rich
pip install json_source_map
# wget https://raw.githubusercontent.com/robproject/fsjd/main/frappe_schema_json_diff.py
chmod +x ./frappe_schema_json_diff.py
echo "GIT_EXTERNAL_DIFF=./frappe_schema_json_diff.py" >> $GITHUB_ENV
echo "TABLE_MODE=1" >> $GITHUB_ENV
- name: Diff on push
if: github.event_name == 'push'
run: |
git --no-pager diff HEAD~1 HEAD
- name: Diff on pull
if: github.event_name == 'pull_request'
run: |
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
git --no-pager diff HEAD~1 HEAD
git --no-pager diff ${{ github.base_ref }}...HEAD