From ffac205b57d444850d5da5f22b01f476af3dc231 Mon Sep 17 00:00:00 2001 From: Charles Overbeck Date: Thu, 1 Aug 2024 10:53:45 -0700 Subject: [PATCH] Handle release events. SEAB-6466 --- upsertGitHubTag/deployment/index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/upsertGitHubTag/deployment/index.js b/upsertGitHubTag/deployment/index.js index b722d00..1bffe49 100644 --- a/upsertGitHubTag/deployment/index.js +++ b/upsertGitHubTag/deployment/index.js @@ -120,6 +120,15 @@ function deleteEndpoint( req.end(); } +function handleReleaseEvent(githubEventType, body, deliveryId, path, callback) { + console.log("Valid release event"); + const fullPath = path + "workflows/github/taggedrelease"; + logPayloadToS3(githubEventType, body, deliveryId); + postEndpoint(fullPath, body, deliveryId, (response) => { + handleCallback(response, "", callback); + }); +} + // Performs an action based on the event type (action) function processEvent(event, callback) { // Usually returns array of records, however it is fixed to only return 1 record @@ -251,6 +260,8 @@ function processEvent(event, callback) { } ); } + } else if (githubEventType === "release") { + handleReleaseEvent(githubEventType, body, deliveryId, path, callback); } else { console.log("Event " + githubEventType + " is not supported"); callback(null, {