Skip to content

Commit

Permalink
Handle release events.
Browse files Browse the repository at this point in the history
  • Loading branch information
coverbeck committed Aug 1, 2024
1 parent 2a3d99c commit ffac205
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions upsertGitHubTag/deployment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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, {
Expand Down

0 comments on commit ffac205

Please sign in to comment.