Skip to content

Commit

Permalink
Use PR number field as the "pr ID"
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpugh committed Nov 21, 2019
1 parent b9be304 commit 5fb1070
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/devshop/devshop_github/devshop_github.module
Original file line number Diff line number Diff line change
Expand Up @@ -1861,8 +1861,8 @@ function devshop_github_create_all_pr_environments($project_node) {
$site_url = url("node/{$environment->site}", array('absolute' => true));

// Get PR ID, if it already has one.
if (!empty($environment->github_pull_request->pull_request_object->id)) {
$environment_pr_id = $environment->github_pull_request->pull_request_object->id;
if (!empty($environment->github_pull_request->number)) {
$environment_pr_id = $environment->github_pull_request->number;
$environment_pr_slug = "pr{$environment_pr_id}";
}
else {
Expand Down Expand Up @@ -1900,7 +1900,7 @@ function devshop_github_create_all_pr_environments($project_node) {

// If there IS PR data on this environment but the PR does NOT exist, queue the site for deletion.
elseif ($environment_pr_id && empty($prs[$environment_pr_slug])) {
drush_log("PR environment $environment->name exists but PR has been closed. [$site_url]", "ok");
drush_log("PR $environment_pr_id environment $environment->name exists but PR has been closed. [$site_url] [PR Slug $environment_pr_slug]", "ok");
if ($project->settings->github['pull_request_environments_delete'] && empty($environment->tasks['delete'])) {
drush_log("PR environment scheduled for deletion: $environment->name [$site_url]", "ok");
hosting_add_task($environment->site, 'delete', array('force' => 1));
Expand Down

0 comments on commit 5fb1070

Please sign in to comment.