From 6d0cc08ad27254e8215e153ea9147a5384a0aaf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E8=8F=9C=E8=8F=9C?= <77663194+Gardenia05@users.noreply.github.com> Date: Wed, 24 Feb 2021 13:49:56 +0800 Subject: [PATCH] Update template_server.rb --- template_server.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/template_server.rb b/template_server.rb index 4f41105..65f720c 100644 --- a/template_server.rb +++ b/template_server.rb @@ -58,10 +58,14 @@ class GHAapp < Sinatra::Application post '/event_handler' do - # # # # # # # # # # # # - # ADD YOUR CODE HERE # - # # # # # # # # # # # # - + # Get the event type from the HTTP_X_GITHUB_EVENT header +case request.env['HTTP_X_GITHUB_EVENT'] +when 'check_suite' + # A new check_suite has been created. Create a new check run with status queued + if @payload['action'] == 'requested' || @payload['action'] == 'rerequested' + create_check_run + end +end 200 # success status end