blob: cb3d0a31f23499c26e7cb4ae03996899008d4c23 [file] [log] [blame]
Paul Sokolovskyb1ba6452022-09-06 15:57:47 +03001#!/bin/bash
2#
3# Copyright (c) 2019-2020, Arm Limited. All rights reserved.
4#
5# SPDX-License-Identifier: BSD-3-Clause
6#
7set -ex
8
9should_post_comment=0
10
11if echo "${GERRIT_PROJECT}" | grep -q sandbox; then
12 should_post_comment=1
13fi
14
15if [ $should_post_comment -eq 1 ]; then
16 mkdir -p ~/.ssh/
17 ssh-keyscan -H -p 29418 $GERRIT_HOST >> ~/.ssh/known_hosts
18
19 quoted="$(python3 -c 'import sys, shlex; print(shlex.quote(open(sys.argv[1]).read()))' misra_delta.txt)"
20
21 ssh -vvvv -o "PubkeyAcceptedKeyTypes +ssh-rsa" -p 29418 -i "$CI_BOT_KEY" "$CI_BOT_USERNAME@$GERRIT_HOST" gerrit \
22 review "$GERRIT_CHANGE_NUMBER,$GERRIT_PATCHSET_NUMBER" \
23 --message "$quoted"
24fi