2015-04-10 15:40:02 +02:00
|
|
|
#!/bin/sh
|
2015-04-10 00:53:46 +02:00
|
|
|
#
|
|
|
|
# changed_templates.sh
|
|
|
|
|
2022-09-16 03:50:39 +02:00
|
|
|
tip="$(git rev-list -1 --parents HEAD)"
|
2021-06-01 03:07:59 +02:00
|
|
|
case "$tip" in
|
2022-09-16 04:18:27 +02:00
|
|
|
# This is a merge commit, pick last parent
|
2021-06-01 03:07:59 +02:00
|
|
|
*" "*" "*) tip="${tip##* }" ;;
|
2022-09-16 04:18:27 +02:00
|
|
|
# This is a non-merge commit, pick itself
|
2021-06-01 03:07:59 +02:00
|
|
|
*) tip="${tip%% *}" ;;
|
|
|
|
esac
|
|
|
|
|
2022-12-16 12:36:15 +01:00
|
|
|
base="$(git merge-base FETCH_HEAD "$tip")"
|
|
|
|
|
|
|
|
[ $(git rev-list --count "$tip" "^$base") -lt 200 ] || {
|
|
|
|
echo "::error title=Branch out of date::Your branch is too out of date. Please rebase on upstream and force-push."
|
2021-06-01 03:23:12 +02:00
|
|
|
exit 1
|
|
|
|
}
|
2021-06-01 03:07:59 +02:00
|
|
|
|
|
|
|
echo "$base $tip" >/tmp/revisions
|
2021-05-24 22:13:35 +02:00
|
|
|
|
2015-04-10 00:53:46 +02:00
|
|
|
/bin/echo -e '\x1b[32mChanged packages:\x1b[0m'
|
2022-09-16 03:50:39 +02:00
|
|
|
git diff-tree -r --no-renames --name-only --diff-filter=AM \
|
2021-06-01 03:07:59 +02:00
|
|
|
"$base" "$tip" \
|
2020-06-10 17:54:08 +02:00
|
|
|
-- 'srcpkgs/*/template' |
|
2020-05-23 15:40:09 +02:00
|
|
|
cut -d/ -f 2 |
|
|
|
|
tee /tmp/templates |
|
|
|
|
sed "s/^/ /" >&2
|