Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-09-26 22:19:49 +0300
committerLukas Reschke <lukas@statuscode.ch>2016-09-26 22:20:01 +0300
commit6a490106bcc090e221fbf266a993416e73c54795 (patch)
tree50153424b368b446bfbced2c5d7cae0d6b1fc4b9 /build/signed-off-checker.php
parent6b2920a6bc6c24ba036f98558c291b665e5fb1d9 (diff)
Read repo name dynamically
This way apps can easily use this as well Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'build/signed-off-checker.php')
-rw-r--r--build/signed-off-checker.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/build/signed-off-checker.php b/build/signed-off-checker.php
index 2a9df75b45c..d4aaf044481 100644
--- a/build/signed-off-checker.php
+++ b/build/signed-off-checker.php
@@ -28,15 +28,27 @@
$baseDir = __DIR__ . '/../';
$pullRequestNumber = getenv('DRONE_PULL_REQUEST');
+$repoOwner = getenv('DRONE_REPO_OWNER');
+$repoName = getenv('DRONE_REPO_NAME');
if(!is_string($pullRequestNumber) || $pullRequestNumber === '') {
echo("The environment variable DRONE_PULL_REQUEST has no proper value.\n");
exit(1);
}
+if(!is_string($repoOwner) || $repoOwner === '') {
+ echo("The environment variable DRONE_REPO_OWNER has no proper value.\n");
+ exit(1);
+}
+
+if(!is_string($repoName) || $repoName === '') {
+ echo("The environment variable DRONE_REPO_NAME has no proper value.\n");
+ exit(1);
+}
+
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-curl_setopt($ch, CURLOPT_URL, 'https://api.github.com/repos/nextcloud/server/pulls/'.$pullRequestNumber.'/commits');
+curl_setopt($ch, CURLOPT_URL, 'https://api.github.com/repos/'.$repoOwner.'/'.$repoName.'/pulls/'.$pullRequestNumber.'/commits');
curl_setopt($ch, CURLOPT_USERAGENT, 'CI for Nextcloud (https://github.com/nextcloud/server)');
$response = curl_exec($ch);
curl_close($ch);