mirror of
https://github.com/moparisthebest/xeps
synced 2024-11-27 11:42:17 -05:00
ci: use git merge-base to detect changed files
This prevents false positives if the branch is not rebased on current main.
This commit is contained in:
parent
bf5bace92e
commit
b028cca04d
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n'
|
||||
filenames="$(git diff-tree -r --no-commit-id --name-status "$1" HEAD | ( grep -P '^[AM]\t(xep-[0-9]{4}|inbox/[^/]+)\.xml$' || true) | cut -f2)"
|
||||
filenames="$(git diff-tree -r --no-commit-id --name-status "$(git merge-base "$1" HEAD)" HEAD | ( grep -P '^[AM]\t(xep-[0-9]{4}|inbox/[^/]+)\.xml$' || true) | cut -f2)"
|
||||
if [ -z "$filenames" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user