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

Hook already exists on this repository #56

Open
ianatarewe opened this issue Jul 13, 2024 · 1 comment
Open

Hook already exists on this repository #56

ianatarewe opened this issue Jul 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ianatarewe
Copy link

Bug Report

Tell us about your environment

  • Concourse version:
    homedepottech/github-webhook-resource:1.3.0

Please show your full resource configuration:

Job:

# Make webhooks
- name: webhooks
  serial: true
  plan:
  - get: git-repo
    trigger: true
    passed: [set-concourse-configs]
  - put: create-arewe-app-webhook
    resource: github-webhook
    params:
      org: arewe-pnw
      repo: arewe-app
      pipeline: arewe-app
      resource_name: git-repo
      webhook_token: ((github.webhook-secret))
      operation: create
      events: [push]
  - put: create-arewe-app-pull-request-webhook
    resource: github-webhook
    params:
      org: arewe-pnw
      repo: arewe-app
      pipeline: arewe-app
      resource_name: github-pull-request
      webhook_token: ((github.webhook-secret))
      operation: create
      events: [pull_request]
  - put: create-arewe-api-gateway-docker-webhook
    resource: github-webhook
    params:
      org: arewe-pnw
      repo: arewe-api-gateway-docker
      pipeline: arewe-api-gateway-docker
      resource_name: git-repo
      webhook_token: ((github.webhook-secret))
      operation: create
      events: [push]
  - put: create-arewe-api-gateway-docker-pull-request-webhook
    resource: github-webhook
    params:
      org: arewe-pnw
      repo: arewe-api-gateway-docker
      pipeline: arewe-api-gateway-docker
      resource_name: github-pull-request
      webhook_token: ((github.webhook-secret))
      operation: create
      events: [pull_request]

And the resources

resources:
- name: git-repo
  type: git
  icon: github
  source:
    uri: [email protected]:arewe-pnw/initial-concourse.git
    branch: master
    private_key: | 
      ((github.sshkey))
- name: github-webhook
  type: github-webhook-resource
  source:
    github_api: https://api.github.com
    github_token: ((github.token))

resource_types:
- name: github-webhook-resource
  type: docker-image
  source:
    repository: homedepottech/github-webhook-resource
    tag: 1.3.0

Describe the issue

What did you do?
Pushed a new version of a pipeline that includes updating webhooks

What did you expect to happen?
nothing, (green)

What actually happened? Please include your pipeline's raw output from the github-webhook-resource.

It failed "Hook already exists on this repository

selected worker: concourse-ci-deployment-5ccb7c474f-f875g
Webhook location: https://api.github.com/repos/arewe-pnw/arewe-app/hooks
Target Concourse resource: https://ci.arewe.date/api/v1/teams/initial-pipeline-team/pipelines/arewe-app/resources/git-repo/check/webhook?webhook_token=34QCJmwQiOiJHTbqXYpF

Error while calling Github: StatusCodeError
Response Status: 422
Message: {
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Hook",
      "code": "custom",
      "message": "Hook already exists on this repository"
    },
    {
      "resource": "Hook",
      "code": "custom",
      "message": "Invalid config attribute: content-type"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/repos/webhooks#create-a-repository-webhook",
  "status": "422"
}

Do you plan to submit a pull request to fix this bug?
no

@ianatarewe ianatarewe added the bug Something isn't working label Jul 13, 2024
@totahuanocotl
Copy link

Might be related to #55 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants