Is it possible to create a global workflow for GitHub actions? - github

I am managing several projects using GitHub actions.
Every repository consist of several workflows which happens on push to branches and on pull requests. Keeping all this configuration (even when sharing actions) is hard.
Is it possible to create and use one global workflow for an event?

Related

Can I create a pull request template that is shared across our repositories?

We have several products developed in each their repositories. We use Azure DevOps for pull requests. We have a Pull Request template that we wish to use on all repositories, hopefully maintaining in a single spot.
Is that possible and how?

View repository activity across all repositories under an account at the same time?

Is there a way to view repository traffic for all repositories on your account at the same time? (without creating your own custom dashboard using the Github API). It would be very convenient. I suspect a bash script might do this without too much effort (e.g. get all repo names, get the traffic/stars stats for each repo in the list). But I want to be sure something obvious doesn't already exist before writing anything myself
I am not ware of any native dashboard that would aggregate multiple GitHub repositories into one convenient view.
You would therefore have to rely on third-party scripts, such as, for example, nchah/github-traffic-stats (Python)
Get statistics on web traffic to your GitHub repositories.
Since it is limited to the last two weeks, you might have to record those statitics over time (example: Microsoft/GitHubTelemetryParsor)

Exception list of the project for organisation level hooks in Github Enterprise

I have a hook configured in Github in Organization level which applies all the projects underneath of that organization by default. But I want to eliminate this hook for specific projects of this organization. Is it possible to set up somehow in Github Enterprise?
No, this isn't possible. You will either need to configure the individual repos to have the hooks you need, or have the org-level hook be smart enough to ignore the things it does not need.
Perhaps you can write a simple webhook forwarder that has the logic you need?

How can I associate a PR with a work item in a different subscription

My distributed team works in two different subscriptions, lets call them
sub1.visualstudio.com and sub2.visualstudio.com. It's not practical to add them as a team in our company account, as suggested here: Can I link a pull request to a work item in a different VSTS account?
Our repo is in sub1.visualstudio.com, but the other team keeps its work items in sub2.visualstudio.com
How can I associate a work item in sub2.visualstudio.com with my PR's in sub1.visualstudio.com?
Alternatively, Is there any way to mirror work items between two subscriptions with some kind of bot connector or something?
afaik, it is not possible to connect PR from one subscription to a WI in another. The only way to link them would be by adding an external hyperlink.
The are a few options to replicate your workitems. For example, one would be to use a Logic App in Azure which will be triggered automatically on update/create etc... The other way would be to use, for example azure-devops-migration-tools and create a schedule.

GitHub API - Equivalent of GitLab's Protected branch API

There is a feature named Protected branches API on GitLab API. Basically, you can restrict all the push and merge access by setting their levels to 0.
I have checked Branches section on GitHub REST API document but I couldn't find the equivalent API. How can I restrict merge and push to a branch on GitHub? Also, I want to remove this restriction after some operations.
protect master branch (do not allow any push, merge etc.)
do something
unprotect master branch
Going to the github api documentation, I see they have added protections. This seems pretty clear how to add proctections using API now.
I don't know a way using the API, but in the UI, you can go to settings > branches and then add some protection rules
You can read more about it here