chore: update action and test workflow #41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |