Skip to content

Commit

Permalink
Add 'make diff' support with yq to workflow Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Jan 5, 2025
1 parent 22c9920 commit a26c7c8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows-src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ test: force build
@git diff --exit-code ../workflows && \
echo -e '\nPASS - No normative changes to .github/workflows'

DIFF_ORIG_COMMIT ?= HEAD
diff:
@for f in $(SOURCE_FILES); do \
f=$${f##*/}; \
diff -u --color=auto \
<(yq -P 'sort_keys(..)' \
-o=props <(git show $(DIFF_ORIG_COMMIT):.github/workflows/$$f) | \
grep -Ev '(^$$|^#)' \
) \
<(yq -P 'sort_keys(..)' \
-o=props ../workflows/$$f | \
grep -Ev '(^$$|^#)'\
); \
done

force:
touch *.yml

Expand Down

0 comments on commit a26c7c8

Please sign in to comment.