Skip to content

Commit

Permalink
work
Browse files Browse the repository at this point in the history
  • Loading branch information
FLYBYME committed Oct 2, 2023
1 parent 1969fc7 commit 18bd361
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions services/github.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ module.exports = {
ref: payload.ref,
commits: payload.commits,
head: payload.head_commit
}
};
}

return {
Expand All @@ -291,30 +291,6 @@ module.exports = {
};
},

/**
* deep walk payload adn strip any keys that include "_url"
*
* @param {Object} payload - github webhook payload
*
* @returns {Object} stripped payload
*/
stripUrls(payload = {}) {
const strippedPayload = {};

const flattened = flatten(payload);

const keys = Object.keys(flattened);

keys.forEach(key => {
if (!key.includes('_url')) {
strippedPayload[key] = flattened[key];
}
});

return unflatten(strippedPayload);
},


/**
* get event key
*
Expand Down Expand Up @@ -353,7 +329,7 @@ module.exports = {
if (!action) {
actionName = 'unknown';
} else {
actionName = action
actionName = action;
}

if (actionName == 'unknown') {
Expand Down

0 comments on commit 18bd361

Please sign in to comment.