From 74f3769dc07c3c612f27b09d003a3d9b6e67090f Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Sun, 17 Dec 2023 12:20:29 -0700 Subject: [PATCH] chore: add `merge_group` to CI workflow (#813) Related to #812. --- .github/workflows/ci.yml | 1 + tools/generate_ci_workflow/internal/github/workflow.go | 3 +++ tools/generate_ci_workflow/internal/github/workflow_test.go | 1 + 3 files changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b38735730..9624ad383 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,7 @@ name: Continuous Integration pull_request: branches: - main + merge_group: {} schedule: - cron: 14 11 * * * concurrency: diff --git a/tools/generate_ci_workflow/internal/github/workflow.go b/tools/generate_ci_workflow/internal/github/workflow.go index dfc64c902..4cc146c5c 100644 --- a/tools/generate_ci_workflow/internal/github/workflow.go +++ b/tools/generate_ci_workflow/internal/github/workflow.go @@ -28,6 +28,7 @@ func NewWorkflowFromYAML(b []byte) (*Workflow, error) { // WorkflowTriggers represents the triggers for a workflow. type WorkflowTriggers struct { PullRequest PullRequestEvent `yaml:"pull_request"` + MergeGroup MergeGroup `yaml:"merge_group"` Schedule []Schedule `yaml:"schedule,omitempty"` } @@ -36,6 +37,8 @@ type PullRequestEvent struct { Branches []string `yaml:"branches,omitempty"` } +type MergeGroup struct{} + // Schedule is the cron schedule for a workflow. type Schedule struct { Cron string `yaml:"cron"` diff --git a/tools/generate_ci_workflow/internal/github/workflow_test.go b/tools/generate_ci_workflow/internal/github/workflow_test.go index c60533428..32b167753 100644 --- a/tools/generate_ci_workflow/internal/github/workflow_test.go +++ b/tools/generate_ci_workflow/internal/github/workflow_test.go @@ -89,6 +89,7 @@ name: Continuous Integration on: pull_request: branches: [ main ] + merge_group: schedule: # Every day at 11:14 UTC. - cron: '14 11 * * *'