tf-github-autoresponse.yaml: add options for the auto response
given a choice for the projects that don't need auto response
Signed-off-by: Arthur She <arthur.she@linaro.org>
Change-Id: Ie143ab8bf319c5e0d6bf099c159152eee2cb91c4
diff --git a/ci/run_github_autoreply.sh b/ci/run_github_autoreply.sh
index 12f9fa9..c2fb203 100755
--- a/ci/run_github_autoreply.sh
+++ b/ci/run_github_autoreply.sh
@@ -18,6 +18,20 @@
exit 1
fi
opts="--token ${AUTH_TOKEN} --repo ${github_repo_full_name}"
-[ -n "${github_issue_num}" ] && opts="${opts} --issue_num ${github_issue_num}"
-[ -n "${github_pr_num}" ] && opts="${opts} --pr_num ${github_pr_num}"
+if [ -n "${github_issue_num}" ]; then
+ if echo "${BYPASS_ISSUE_RESPONSE_PROJ}" | grep -q "${github_repo_full_name}"; then
+ echo "No need to response ${github_repo_full_name} for the issue creation"
+ exit 0
+ else
+ opts="${opts} --issue_num ${github_issue_num}"
+ fi
+fi
+if [ -n "${github_pr_num}" ]; then
+ if echo "${BYPASS_PR_RESPONSE_PROJ}" | grep -q "${github_repo_full_name}"; then
+ echo "No need to response ${github_repo_full_name} for the PR creation"
+ exit 0
+ else
+ opts="${opts} --pr_num ${github_pr_num}"
+ fi
+fi
python3 $(dirname "${BASH_SOURCE[0]}")/github_autoreply_bot.py ${opts}
diff --git a/tf-github-autoresponse.yaml b/tf-github-autoresponse.yaml
index b242ac6..ce48966 100644
--- a/tf-github-autoresponse.yaml
+++ b/tf-github-autoresponse.yaml
@@ -6,6 +6,17 @@
display-name: 'TF Github auto response'
project-type: freestyle
node: master
+ parameters:
+ - string:
+ name: BYPASS_ISSUE_RESPONSE_PROJ
+ description: |
+ The projects that don't need the issue response
+ default: 'TrustedFirmware-A/trusted-firmware-a TrustedFirmware-A/tf-a-ci-scripts TrustedFirmware-A/tf-a-tests'
+ - string:
+ name: BYPASS_PR_RESPONSE_PROJ
+ description: |
+ The projects that don't need the PR response
+ default: ''
builders:
- shell: |-
#!/bin/bash