@grimoire-rs/indexer 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -39,6 +39,29 @@ grim-indexer:validate:
|
|
|
39
39
|
GIT_DEPTH: 0
|
|
40
40
|
rules:
|
|
41
41
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
42
|
+
# The job image is picked for `npx`, and `node:*-alpine` ships no git —
|
|
43
|
+
# but this job diffs the merge request against its target branch, so git
|
|
44
|
+
# is not optional. GitLab's runner clones with a separate helper image, so
|
|
45
|
+
# nothing else puts git in here. Install it for whichever package manager
|
|
46
|
+
# the (overridable) image has.
|
|
47
|
+
#
|
|
48
|
+
# The trailing check is the load-bearing part: the gate's contract is
|
|
49
|
+
# "exit 0 = eligible for auto-merge", so a missing or failed-to-install
|
|
50
|
+
# tool must fail the job, never silently skip validation.
|
|
51
|
+
before_script:
|
|
52
|
+
- |
|
|
53
|
+
set -eu
|
|
54
|
+
if ! command -v git >/dev/null 2>&1; then
|
|
55
|
+
if command -v apk >/dev/null 2>&1; then
|
|
56
|
+
apk add --no-cache git
|
|
57
|
+
elif command -v apt-get >/dev/null 2>&1; then
|
|
58
|
+
apt-get update -qq && apt-get install -y -qq --no-install-recommends git
|
|
59
|
+
fi
|
|
60
|
+
fi
|
|
61
|
+
command -v git >/dev/null 2>&1 || {
|
|
62
|
+
echo "grim-indexer: the gate needs git, and ${GRIM_INDEXER_NODE_IMAGE} has none" >&2
|
|
63
|
+
exit 1
|
|
64
|
+
}
|
|
42
65
|
script:
|
|
43
66
|
- |
|
|
44
67
|
set -eu
|