Github custom pull request template - github

Currently, Github supports a pull request template present in the default branch(Link). In our team, we want to configure pull request template based on the folder or file modified.
Example configuration we want to support:
documentation/ : DOCUMENTATION_TEMPLATE.md
src/**/*.h : INTERFACE_TEMPLATE.md
src/**/*.cpp : IMPLEMENTATION_TEMPLATE.md
.config/ : CONFIGURATION_TEMPLATE.md
From the Github documentation for Pull requests templates, this seems to be not possible. Can this be achieved either by using Github Webhooks or Github apps?

I have contacted Github and they informed that currently this is not possible. So we ended building a Github App

Related

Deploy changes from GitHub to Salesforce

How can I add a custom button on GitHub.com which I could click on in order to deploy changes from the Master branch to a related Salesforce.com DEV Org?
What have you tried? Have you seen https://developer.salesforce.com/blogs/2020/01/using-salesforce-dx-with-github-actions ?
You can steal sample actions from SF official repo at https://github.com/trailheadapps/lwc-recipes.
You'll need to provide the secret login URL to your target org, there are blog posts how to generate it and store in GitHub variable, for example https://tigerfacesystems.com/blog/sfdx-continuous-integration/ or https://github.com/sfdx-actions/setup-sfdx
Last but not least - to have action available for manual run (not just automated) read up about "workflow_dispatch"

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

How to prevent the pull request integration for SonarQube to report issues as inline comments on Githuib?

I configured SonarQube analysis to report it's status to pull requests on my GitHub project. SonarCloud already supports pull requests as first class citizen as described in https://blog.sonarsource.com/sonarcloud-loves-your-build-pipeline. As I understand, this kind of integration is not using the GitHub Plugin for SonarQube.
The configuration provides these properties (look here for the complete configuration)
sonar.pullrequest.provider
sonar.pullrequest.github.repository
sonar.pullrequest.branch
sonar.pullrequest.key
The credentials for the technical user are set in the SonarCloud project administration.
You can see the results here: https://github.com/BudgetFreak/BudgetFreak/pull/86#pullrequestreview-125364230
Every issue is reported as an inline comment, one summary comment is made and the status is reported for the code-quality/sonarqube check.
I would like to disable the inline comment on every issue. This was possible using the GitHub plugin. Can this also be achieved with the new pull request integration?
Unfortunately, on SonarCloud, this feature is not available.

How to create deployment links in a Github PR?

I've noticed Github allows linking to deployments:
I currently have Travis CI doing automatic builds on new PRs and deploying the artifacts to transfer.sh. How could I get such a link to View deployment to show up in my Github PR?
You need to add an environment_url field when POST'ing the deployment status.
Additionally, you need to use the application/vnd.github.ant-man-preview+json Content-Type header as it's still a developer preview feature.
More info:
It's mentioned in the API docs https://developer.github.com/v3/repos/deployments/#create-a-deployment-status
https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements/#link-to-a-live-deployment

Update my website from a github repository

I use a website for testing purposes. Part of what I test is a public repository on GitHub. What I would like to do is have my site periodically check the repository and pull any changes to a folder in my site.
I'm using a LAMP server, is there some php and a cronjob that I can use to check and get the files from the repository?
I would use the webhooks Github allows. See here for a simple PHP example that executes a auto-pull if the Github repository gets updated.