File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
33# SPDX-License-Identifier: BSD-3-Clause
44
5+ readlink -f / & > /dev/null || readlink () { greadlink " $@ " ; } # for MacOS
6+ MYPROG=$( readlink -f -- " $0 " )
7+ MYDIR=$( dirname -- " $MYPROG " )
8+
59debug () { echo " ::debug::$1 " >&2 ; } # message
610error () { echo " ::error::$1 " >&2 ; } # message
711
812# https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-commits-on-a-pull-request
913get_pr_commits () {
1014 if [ -n " $TEST_MODE " ] ; then
1115 debug " Using list_commits test data"
12- cat . /test/pr_list_commits.json
16+ cat " $MYDIR " /test/pr_list_commits.json
1317 return
1418 fi
1519 [ " $COMMITS_COUNT " -gt 100 ] && debug " Needs pagination"
5458RESULT=0
5559while read -r pr_commit ; do
5660 debug " Running check on: $pr_commit "
57- . /src/check_email.sh --json " $pr_commit " " ${TEST_MODE[@]} " || RESULT=1
61+ " $MYDIR " /src/check_email.sh --json " $pr_commit " " ${TEST_MODE[@]} " || RESULT=1
5862done < <( get_pr_commits | split_commits_and_add_metadata)
5963
6064exit $RESULT
You can’t perform that action at this time.
0 commit comments