Skip to content

Commit

Permalink
propagate both the "added" and "removed" varieties of the "installati…
Browse files Browse the repository at this point in the history
  • Loading branch information
svonworl authored Mar 27, 2024
1 parent fc32aad commit 3afb39f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 deletions.
31 changes: 13 additions & 18 deletions upsertGitHubTag/deployment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,24 +166,19 @@ function processEvent(event, callback) {
var githubEventType = requestBody["X-GitHub-Event"];
// Handle installation events
if (githubEventType === "installation_repositories") {
// Currently ignoring repository removal events, only calling the endpoint if we are adding a repository.
if (body.action === "added") {
console.log("Valid installation event");
path += "workflows/github/install";
const repositoriesAdded = body.repositories_added;
const repositories = repositoriesAdded.map((repo) => repo.full_name);

postEndpoint(path, body, deliveryId, (response) => {
const successMessage =
"The GitHub app was successfully installed on repositories " +
repositories;
handleCallback(response, successMessage, callback);
});
} else {
console.log(
'installation_repositories event ignored "' + body.action + '" action'
);
}
// The installation_repositories event contains information about both additions and removals.
console.log("Valid installation event");
path += "workflows/github/install";
postEndpoint(path, body, deliveryId, (response) => {
const added = body.action === "added";
const repositories = (
added ? body.repositories_added : body.repositories_removed
).map((repo) => repo.full_name);
const successMessage = `The GitHub app was successfully ${
added ? "installed" : "uninstalled"
} on repositories ${repositories}`;
handleCallback(response, successMessage, callback);
});
} else if (githubEventType === "push") {
/**
* We only handle push events, of which there are many subtypes. Unfortunately, the only way to differentiate between them is to look
Expand Down
5 changes: 0 additions & 5 deletions wdl-parsing/WDLParsingFunction/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
</repository>
<repository>
<id>artifacts.oicr.on.ca</id>
<name>artifacts.oicr.on.ca</name>
<url>https://artifacts.oicr.on.ca/artifactory/collab-release</url>
</repository>
<repository>
<id>artifactory.broadinstitute.org</id>
<name>artifactory.broadinstitute.org</name>
Expand Down

0 comments on commit 3afb39f

Please sign in to comment.