Skip to content

Commit 6eb8130

Browse files
authored
2 parents bc85af7 + 11d2a17 commit 6eb8130

File tree

6 files changed

+7
-82
lines changed

6 files changed

+7
-82
lines changed

Diff for: .circleci/config.yml

-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ jobs:
3232
- create_zip_upload_to_s3:
3333
lambdaFolder: "edge-lambda-for-s3/deployment"
3434
s3BucketFolder: "edgeLambdaForS3404s"
35-
- create_zip_upload_to_s3:
36-
lambdaFolder: "upsertGitHubTag/deployment"
37-
s3BucketFolder: "upsertGitHubTag"
3835
- create_zip_upload_to_s3:
3936
lambdaFolder: "webhook-testing/deployment"
4037
s3BucketFolder: "webhookTesting"

Diff for: .github/workflows/maven.yml

-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ jobs:
2727
run: |
2828
python -m pip install --upgrade pip
2929
pip install aws-sam-cli
30-
- name: Test with SAM CLI
31-
working-directory: ./upsertGitHubTag
32-
run: |
33-
sam local invoke HelloWorldFunction -e events/event.json -n env.json &> output.txt
34-
grep "Valid push event" output.txt
3530
- name: Test wdl parsing with SAM CLI build and invoke
3631
working-directory: ./wdl-parsing
3732
run: |

Diff for: upsertGitHubTag/deployment/index.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const url = require("url");
44
const https = require("https");
5+
const http = require("http");
56
const crypto = require("crypto");
67
const LAMBDA_USER_AGENT = "DockstoreLambda (NodeJs)";
78
const DELIVERY_ID_HEADER = "X-GitHub-Delivery";
@@ -25,6 +26,10 @@ const verifyGitHub = (req, payload) => {
2526
);
2627
};
2728

29+
function getProtocol(url) {
30+
return url.protocol === "http:" ? http : https;
31+
}
32+
2833
// Makes a POST request to the given path
2934
function postEndpoint(path, postBody, deliveryId, callback) {
3035
console.log("POST " + path);
@@ -39,7 +44,7 @@ function postEndpoint(path, postBody, deliveryId, callback) {
3944
"X-GitHub-Delivery": deliveryId,
4045
};
4146

42-
const req = https.request(options, (res) => {
47+
const req = getProtocol(options).request(options, (res) => {
4348
var chunks = [];
4449
var bodyString = "";
4550

@@ -94,7 +99,7 @@ function deleteEndpoint(
9499
"X-GitHub-Delivery": deliveryId,
95100
};
96101

97-
const req = https.request(options, (res) => {
102+
const req = getProtocol(options).request(options, (res) => {
98103
var chunks = [];
99104

100105
res.on("data", function (chunk) {

Diff for: upsertGitHubTag/env.json

-5
This file was deleted.

Diff for: upsertGitHubTag/events/event.json

-21
This file was deleted.

Diff for: upsertGitHubTag/template.yaml

-46
This file was deleted.

0 commit comments

Comments
 (0)