Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub filter fixes #200

Merged
merged 2 commits into from
Dec 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions github-filter/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const hcConfig: Config = {
};

interface Env {
LABELS: KVNamespace;
labels: KVNamespace;
}

const worker = {
Expand Down Expand Up @@ -78,7 +78,7 @@ const worker = {

// Send data to any extra label webhooks
let extraChannels = (json.issue || json.pull_request)?.labels?.map(async (label: { [key: string]: string }) => {
let result = await sendLabelWebhook(label.name, data, env.LABELS);
let result = await sendLabelWebhook(label.name, data, env.labels);

if (result) {
return result;
Expand Down Expand Up @@ -140,7 +140,7 @@ async function sendWebhook(id: string, token: string, data: Data) {
// Pass on data to Discord as usual
const response = await fetch(template, new_request);
if (!response.ok) {
return new Response(response.json(), {
return new Response(await response.json(), {
status: response.status,
});
}
Expand Down