Skip to content

Github Actions custom deployment protection rule approval not working #144720

Closed Answered by juicemia
juicemia asked this question in API and Webhooks
Discussion options

You must be logged in to vote

I was able to figure this out with the help of Github Support.

According to the docs for creating an environment, the environment name isn't case sensitive. However, it seems like when passing the environment name in the HTTP request, the environment name is case sensitive.

The working code looks like this:

interface WebhookPayload {
  deployment_callback_url: string;
  environment: string;
  deployment: {
    environment: string;
  };
  installation: {
    id: number;
  };
  repository: {
    id: number;
    name: string;
    owner: {
      login: string;
    };
  };
}

export const POST = async (request: NextRequest): Promise<NextResponse> => {
  // TODO: verify header with HMAC(buf, se…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by juicemia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working correctly API and Webhooks Discussions and conversations related to APIs or Webhooks
1 participant