fix(github): skip PR previews from head commit flags

This commit is contained in:
Andras Bacsai
2026-07-08 13:31:23 +02:00
parent 18f0f7f6be
commit f4f4274cee
3 changed files with 82 additions and 4 deletions
+10 -4
View File
@@ -96,7 +96,16 @@ class ProcessGithubPullRequestWebhook implements ShouldBeEncrypted, ShouldQueue
return;
}
if (self::shouldSkipDeployAny([$this->pullRequestTitle])) {
$repository_parts = explode('/', $this->fullName);
$owner = $repository_parts[0] ?? '';
$repo = $repository_parts[1] ?? '';
$headCommitMessage = null;
if ($this->action === 'synchronize') {
$headCommitMessage = getGithubCommitMessage($githubApp, $owner, $repo, $this->commitSha);
}
if (self::shouldSkipDeployAny([$this->pullRequestTitle, $headCommitMessage])) {
return;
}
@@ -120,9 +129,6 @@ class ProcessGithubPullRequestWebhook implements ShouldBeEncrypted, ShouldQueue
// Get changed files for watch path filtering
$changed_files = collect();
$repository_parts = explode('/', $this->fullName);
$owner = $repository_parts[0] ?? '';
$repo = $repository_parts[1] ?? '';
if ($this->action === 'synchronize' && $this->beforeSha && $this->afterSha) {
// For synchronize events, get files changed between before and after commits