discord webhook for github organization - github

What I find really useful and awesome about discord is how easy is to setup a webhook. I have channels dedicated just to some repos I have on github, usually inside an organization.
I realised just today that in Github you add a webhook to an entire organization and that would be great for me. like this:
But after having set up the webhook, and successfully sent some test POST (through the github UI), I see no messages in the related channel.
Is it just me with this issue?
N.B.: It doesn't give me a error when I add the webhook for the Organization.
I just don't receive the message on Discord
EDIT: Okay. I restricted the issue to these actions. I don't see any messages for these actions:
Creating a repository
deleting a repository

Related

Why does GitLab need full access read and write permissions when importing a GitHub repo?

I just signed up for GitLab, after learning about this cool feature where you can import your GitHub repositories and keep the two in sync. The import feature seems simple enough, but I paused when I got to the step where I authorize GitLab to my GitHub account. Why does it need so many permissions? Some make sense to me, others not so much. Specifically:
Personal user data
Full access
This application will be able to read and write all user data. This
includes the following:
Private email addresses
Private profile information
Followers
I understand why it needs to read and write to all public and private repository data. It's moving all that data to GitLab, and it needs to write to keep it in sync. What I don't understand is why it needs write permissions to my email and profile information?
I know that GitLab is a reputable company that didn't just pop up yesterday, but I am still wary when giving full access permissions to any service. If someone could help me understand, that would be appreciated.
You have two options when migrating a repository from GitHub to GitLab. You can migrate using only the url, in which case what you’ll have on GitLab is more similar to what you’d get if you simply added an additional remote in the repo - the full repo will be there, but everything specific to GitHub - the pull requests, comments, issues, etc, as well as all users tagged or participating - will be lost.
Alternatively, you can use the GitHub importer. This option fully migrates the GitHub repo to GitLab, setting up the GitLab equivalents of GitHub features (pull requests become merge requests, etc.). And part of this involves assigning users to each comment, mention, PR, etc.
From the gitlab docs:
When issues and pull requests are being imported, the importer attempts to find their GitHub authors and assignees in the database of the GitLab instance. Pull requests are called merge requests in GitLab.
For this association to succeed, each GitHub author and assignee in the repository must meet one of the following conditions prior to the import:
Have previously logged in to a GitLab account using the GitHub icon.
Have a GitHub account with a public-facing email address that matches their GitLab account’s email address.
GitLab content imports that use GitHub accounts require that the GitHub public-facing email address is populated. This means all comments and contributions are properly mapped to the same user in GitLab. GitHub Enterprise does not require this field to be populated so you may have to add it on existing accounts.
So yes, these are required if you want the full GitHub mirror or migration. If you just want the git repo contents, use the import from url tool, and the requirements will be much less extensive.

GitHub Webhook Not Sending Messages for Changes in Projects Tab to my Discord Channel

This problem is probably best suited for the devs at GitHub but I'll post it here anyway for others with the same issue.
The GitHub Webhook works just fine on Discord sending notifications about any changes in the repos but any changes to the Projects tab does not get updated to Discord via the Webhook.

Integrating slack with github to get notifications on push happening to specific branch

I am looking for a way how i can get a message to slack channel when a push happens in specific branch of github repo.
I tried doing it with below mentioned steps -
1. Installed github app in slack.
2. Added github to slack channel using /github.
After that when i try connecting to repository, github asked to authenticate. When i tried to do so it is navigating me to github.com instead of custom github domain of the company.
Please help me here.
You could add to your repository a .github/workflows in order to use a GitHub Action (which is also available for GitHub Enterprise, not just github.com)
For example:
pullreminders/slack-action
An action which wraps the Slack chat.postMessage API method for posting to channels, private groups, and DMs.
This action sends messages using Slack bot tokens, which have two main advantages compared to user tokens and incoming webhooks:
Bots can't be disabled inadvertently when a Slack user is disabled or removed. Slack has written about this in a recent announcement, and
Bots offer a powerful range of capabilities that can be leveraged to perform more functions.
If you have a Drone continuous integration system in place you can use a webhook to trigger sending a Slack notification. This would work for the repository .drone.yml file:
- name: slack
image: plugins/slack
settings:
webhook: https://hooks.slack.com/services/...
channel: my_awesome_channel
username: Github Bot
when:
event: [ pull_request ]
branch: [ dev, master ]
template: |
New Pull Request Opened By: {{build.author}} ({{repo.name}} / {{build.branch}})
{{build.link}}
This assumes that drone is already enabled and the webhook configured in Github. If it isn't you can enable it through the Drone web dashboard by navigating to Repositories and clicking the green switch next to your repo name.
For custom github domain of company you need to use slack app (Githhub Enterprise Server) instead of Github App.
Once you are done with installation of Githhub Enterprise Server App on slack , Under configuration you will se payload url. Copy payload URL and go to github repository settings add webhooks sections and add payload url there and keep content type application/json

Should GitHub Pages https:<moniker>.github.io/<repo> point to Read-the-docs build?

I have a GitHub repo of docs linked to my RTD account. The GitHub/RTD connection appears to be set up correctly with a functional webhook (green checks at both ends). Commits to the repo trigger a successful build on RTD as expected. RTD is an Authorized OAuth App and my RTD account is connected to my GitHub account.
Under Settings -> GitHub pages, I have tried both master branch and master branch/docs. I would expect https://moniker.github.io/repo-name/ to go to the connected RTD docs. But it just shows the repo-name/README.md file, not the repo-name.rtfd.io docs. Am I misunderstanding the linkage or the use of GitHub Pages? Or am I completely missing something? Thanks for any insight.
I put in a help desk question to GitHub and their response was:
GitHub Pages provides its own web hosting and will not integrate with external services. If you're publishing your site elsewhere GitHub Pages will not link to it.
So the answer is "no", adding the webhook only triggers a new build on commits and I do explicitly need a docs/index.html (or .md) that redirects to the RTD documentation.

Jenkins github plugin returns error 400 "Hook should contain event type"

At my company we have a Github Enterprise instance keeping all of our source in line, and Jenkins servers to do continuous integration. I'm using the Jenkins github plugin on Jenkins, and installing a service on Github to call MYJENKINS/github-webhook.
I would see the POSTs arriving from github on the jenkins server, but nothing would happen. The access log reports a 400 error being returned to github.
To find out what was being returned, I put tcpdump on the port. I now see that Jenkins is returning "Error 400 Hook should contain event type". It returns that for all repository events.
I can probably capture the github POST payload with tcpdump, but haven't done that yet.
My only guess at the moment is that our Github Enterprise installation is an earlier version than what is expected by the Jenkins github plug-in.
Update: As an experiment, on Github, I changed the call from a Service ("Jenkins github plugin") to a Webhook, but using the same URL MY_JENKINS/github-webhook/. THAT succeeds, is parsed successfully by the github plugin, and triggers the jobs that are watching a project/branch.
Github Enterprise should have webhook functionality built-in, so I'm a little unsure what you mean when you say you're installing a service on Github.
You can set up new webhooks by going to the following tab:
https://github-enterprise.com/my-org/myrepo >> Settings >> Webhooks & services
Here is a screenshot:
The other place to check is the settings in Jenkins, to make sure that it is set up to work with Github.
Jenkins >> Manage Jenkins >> Configure System >> Find: GitHub Plugin Configuration
In here, you need to provide your credentials for Github as well as the Github api url:
https://<github-enterprise.com>/api/v3/
(You might be able to leave the 'Custom Github API URL' unchecked, but I haven't had good success with that.)
Here is a screenshot:
The 'Credentials' would be an access token from Github.
Github >> Personal settings >> Personal access tokens
It's been a while since I've done setup like this, so feel free to correct me if I'm wrong about anything.