Skip to content

Commit

Permalink
feat!: use GIT_EXTERNAL_DIFF
Browse files Browse the repository at this point in the history
Remove all file preparation, now handled by git.
Remove submodule.
Rework sample workflow.
Update doc.
Rework diff script to be used by GIT_EXTERNAL_DIFF.
Remove VSCode launch config.

BREAKING CHANGE: Total rework
  • Loading branch information
Robert Duncan committed Oct 21, 2023
1 parent 45faf55 commit 850cc7b
Show file tree
Hide file tree
Showing 7 changed files with 379 additions and 112 deletions.
55 changes: 6 additions & 49 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,59 +15,16 @@ jobs:
ref: ${{ github.ref }}
fetch-depth: 2

- name: Find changed json
id: changed-json
uses: tj-actions/[email protected]
with:
files: |
**/*.json
include_all_old_new_renamed_files: true

- name: Copy head paths files
run: |
mkdir head
touch head/acmr.txt
for file in ${{ steps.changed-json.outputs.added_files }}; do
echo "A,head/${file}" >> head/acmr.txt
cp --parents $file head/
done
for file in ${{ steps.changed-json.outputs.copied_files }}; do
echo "C,head/${file}" >> head/acmr.txt
cp --parents $file head/
done
for file in ${{ steps.changed-json.outputs.modified_files }}; do
echo "M,head/${file}" >> head/acmr.txt
cp --parents $file head/
done
for file in ${{ steps.changed-json.outputs.renamed_files }}; do
echo "R,head/${file}" >> head/acmr.txt
cp --parents $file head/
done
- name: Checkout base
run: git checkout $(git --no-pager log --oneline -n 2 | awk 'NR==2 {print $1}')

- name: Copy base paths
run: |
mkdir base
touch base/mrd.txt
for file in ${{ steps.changed-json.outputs.modified_files }}; do
echo "M,${file}" >> base/mrd.txt
done
for file in ${{ steps.changed-json.outputs.all_old_new_renamed_files }}; do
echo "R,${file}" >> base/mrd.txt
done
for file in ${{ steps.changed-json.outputs.deleted_files }}; do
echo "D,${file}" >> base/mrd.txt
done
- name: Setup requirements and script
run: |
pip install rich
pip install json_source_map
git clone --depth 1 https://gist.github.com/74017707b676c3ce947528fb00dd46d0.git fsjd
wget https://raw.githubusercontent.com/robproject/fsjd/main/frappe_schema_json_diff.py
- name: Diff table
run: python3 fsjd/frappe_schema_json_diff.py base/mrd.txt head/acmr.txt 1
- name: Run script file
run: |
chmod +x ./run.sh
./run.sh
shell: bash


3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

23 changes: 0 additions & 23 deletions .vscode/launch.json

This file was deleted.

36 changes: 0 additions & 36 deletions .vscode/tasks.json

This file was deleted.

Loading

0 comments on commit 850cc7b

Please sign in to comment.