aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml24
1 files changed, 24 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2a2d3ea6db0c7..124f1f9601016 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -64,3 +64,27 @@ pr-checks:
GITLAB_TOKEN="$MR_AUTOMATION_TOKEN" glab mr --repo "SlackBuilds.org/slackbuilds" comment $(echo "$CI_OPEN_MERGE_REQUESTS" | cut -d '!' -f2) --unique=true --message "$(cat comment-output)"
fi
done
+
+ git diff-tree --name-only --diff-filter=d --no-commit-id -r $CI_MERGE_REQUEST_DIFF_BASE_SHA $CI_COMMIT_SHA | sed '/^\./d' | sed -n '/[^\/][^\/]*\/[^\/][^\/]*\//p' | xargs -I xx dirname xx | sort -u | while read -r project ; do
+ short_project="$(printf '%s\n' "$project" | cut -d/ -f2)"
+ response="$(wget -q -O - "https://slackbuilds.org/revdeps.php?q=$short_project" | sort)"
+
+ {
+ printf '#### reverse dependencies - %s\n\n' "$project"
+ if [[ "$response" == "" ]] ; then
+ printf 'None\n'
+ else
+ printf '```\n'
+ printf '%s' "$response"
+ printf '```\n'
+ fi
+ } > comment-output
+
+ if [ -z "$MR_AUTOMATION_TOKEN" ] ; then
+ printf 'No token available for MR comments\n'
+ cat comment-output
+ else
+ # $CI_PROJECT_PATH points to the fork
+ GITLAB_TOKEN="$MR_AUTOMATION_TOKEN" glab mr --repo "SlackBuilds.org/slackbuilds" comment $(echo "$CI_OPEN_MERGE_REQUESTS" | cut -d '!' -f2) --unique=true --message "$(cat comment-output)"
+ fi
+ done