Skip to content

Commit

Permalink
Fix header
Browse files Browse the repository at this point in the history
  • Loading branch information
kathy-t committed Aug 10, 2023
1 parent 5cd52c4 commit 96ef78c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions upsertGitHubTag/deployment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ function postEndpoint(path, postBody, deliveryId, callback) {
const options = url.parse(path);
options.method = "POST";
options.headers = {
"Content-Type": "application/x-www-form-urlencoded",
"Content-Type": "application/json",
Authorization: "Bearer " + process.env.DOCKSTORE_TOKEN,
"User-Agent": LAMBDA_USER_AGENT,
DELIVERY_ID_HEADER: deliveryId,
"X-GitHub-Delivery": deliveryId,
};

const req = https.request(options, (res) => {
Expand Down Expand Up @@ -90,7 +90,7 @@ function deleteEndpoint(
options.headers = {
Authorization: "Bearer " + process.env.DOCKSTORE_TOKEN,
"User-Agent": LAMBDA_USER_AGENT,
DELIVERY_ID_HEADER: deliveryId,
"X-GitHub-Delivery": deliveryId,
};

const req = https.request(options, (res) => {
Expand Down Expand Up @@ -146,6 +146,7 @@ function processEvent(event, callback) {

// Handle installation events
const deliveryId = requestBody[DELIVERY_ID_HEADER];
console.log("X-GitHub-Delivery: " + deliveryId);
var githubEventType = requestBody["X-GitHub-Event"];
if (githubEventType === "installation_repositories") {
// Currently ignoring repository removal events, only calling the endpoint if we are adding a repository.
Expand Down Expand Up @@ -211,7 +212,7 @@ function processEvent(event, callback) {

path += "workflows/github";

deleteEndpoint(path, repository, gitReference, username, (response) => {
deleteEndpoint(path, repository, gitReference, username, deliveryId, (response) => {

Check failure on line 215 in upsertGitHubTag/deployment/index.js

View workflow job for this annotation

GitHub Actions / linterWithESLint

Replace `path,·repository,·gitReference,·username,·deliveryId,` with `⏎········path,⏎········repository,⏎········gitReference,⏎········username,⏎········deliveryId,⏎·······`
const successMessage =

Check failure on line 216 in upsertGitHubTag/deployment/index.js

View workflow job for this annotation

GitHub Actions / linterWithESLint

Insert `··`
"The associated versions on Dockstore for repository " +

Check failure on line 217 in upsertGitHubTag/deployment/index.js

View workflow job for this annotation

GitHub Actions / linterWithESLint

Insert `··`
repository +

Check failure on line 218 in upsertGitHubTag/deployment/index.js

View workflow job for this annotation

GitHub Actions / linterWithESLint

Replace `··········` with `············`
Expand Down

0 comments on commit 96ef78c

Please sign in to comment.