Skip to content

Commit 3afb39f

Browse files
authored
propagate both the "added" and "removed" varieties of the "installation_repositories" event
https://ucsc-cgl.atlassian.net/browse/SEAB-6000
1 parent fc32aad commit 3afb39f

File tree

2 files changed

+13
-23
lines changed

2 files changed

+13
-23
lines changed

upsertGitHubTag/deployment/index.js

+13-18
Original file line numberDiff line numberDiff line change
@@ -166,24 +166,19 @@ function processEvent(event, callback) {
166166
var githubEventType = requestBody["X-GitHub-Event"];
167167
// Handle installation events
168168
if (githubEventType === "installation_repositories") {
169-
// Currently ignoring repository removal events, only calling the endpoint if we are adding a repository.
170-
if (body.action === "added") {
171-
console.log("Valid installation event");
172-
path += "workflows/github/install";
173-
const repositoriesAdded = body.repositories_added;
174-
const repositories = repositoriesAdded.map((repo) => repo.full_name);
175-
176-
postEndpoint(path, body, deliveryId, (response) => {
177-
const successMessage =
178-
"The GitHub app was successfully installed on repositories " +
179-
repositories;
180-
handleCallback(response, successMessage, callback);
181-
});
182-
} else {
183-
console.log(
184-
'installation_repositories event ignored "' + body.action + '" action'
185-
);
186-
}
169+
// The installation_repositories event contains information about both additions and removals.
170+
console.log("Valid installation event");
171+
path += "workflows/github/install";
172+
postEndpoint(path, body, deliveryId, (response) => {
173+
const added = body.action === "added";
174+
const repositories = (
175+
added ? body.repositories_added : body.repositories_removed
176+
).map((repo) => repo.full_name);
177+
const successMessage = `The GitHub app was successfully ${
178+
added ? "installed" : "uninstalled"
179+
} on repositories ${repositories}`;
180+
handleCallback(response, successMessage, callback);
181+
});
187182
} else if (githubEventType === "push") {
188183
/**
189184
* We only handle push events, of which there are many subtypes. Unfortunately, the only way to differentiate between them is to look

wdl-parsing/WDLParsingFunction/pom.xml

-5
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@
2626
<url>https://repo.maven.apache.org/maven2</url>
2727
<layout>default</layout>
2828
</repository>
29-
<repository>
30-
<id>artifacts.oicr.on.ca</id>
31-
<name>artifacts.oicr.on.ca</name>
32-
<url>https://artifacts.oicr.on.ca/artifactory/collab-release</url>
33-
</repository>
3429
<repository>
3530
<id>artifactory.broadinstitute.org</id>
3631
<name>artifactory.broadinstitute.org</name>

0 commit comments

Comments
 (0)