Share GitHub Actions workflow within organization - github

It seems like it's possible to create a .github repository within the organization and share workflows across my org.
The problem is, it seems like the .github repo must be public. What's the idea behind this? Why would I want to create a public repo for all my workflows within my organization?
I thought switching to GitHub Enterprise would help me on this matter, but it doesn't looks like it does.
Any ideas?

https://github.com/github/roadmap/issues/51
private repository for workflow templates is on the Roadmap but its indeed does not supported at the moment.
too bad.

There is a workaround to share your github action workflows privately. You can create a private repo and save your workflows as template.
https://medium.com/#er.singh.nitin/how-to-share-the-github-actions-workflow-in-an-organization-privately-c3bb3e0deb3

This is now generally available for GitHub Enterprises
https://github.blog/changelog/2022-03-04-sharing-github-actions-within-your-enterprise-is-now-ga/
https://docs.github.com/enterprise-cloud#latest/actions/creating-actions/sharing-actions-and-workflows-with-your-enterprise

Related

how to allow 3rd party to create repo (repo transfer) in our Org without let them see our private repo?

We have hired a 3rd party to work on a project, we started by not creating any Repo on our Github, but they started with their Repo. So now it's time to transfer the repo. However, in order to transfer the repo, the developer is asking permission to create a Repo in our Org... but as far as I know, I can only invite him first as a collaborator, a member, before he can create any private repo in our Org... that means he can see our other repo...
I couldn't find any good answer online, please help. Thanks!
Have you tried using Github's Organization features? You can create an organization with your team members in it, and control who has access to what.
Here's a Github page that explains a bit more about how it works.
Do not add them as a member to your Org! (this is the only option today from Github, nor owners...of course). If you do so, this will give your external developer access to all of your repos.
The only way I found you can safely invite an external user is to create a Repo first, then add them in that Repo. By doing that, they will be invited only to that repo, and have no access to the others.
This is my workaround. If you have a better solution, please do comment. I am curious how the "transfer" feature works.

How to prevent pushes to a private repository in Github

We have a repository in GitHub. We want a group of developers to be able to view and fork this repository. But we'd like to prevent them from committing to our branches. Instead, we want this group of developers to fork the repo and create pull requests to contribute. Is there any way to achieve this in GitHub?
Access control is no longer available for private repositories. Both read and write access is given to the collaborators.
If a collaborator will have only read access to a repository, you must create an organization.
You need to add collaborator to your repository and give them just read access, look following article:
https://help.github.com/articles/adding-collaborators-to-a-personal-repository/

How to create a post-service hook on a public github repository?

I have no problem in creating hooks for my own repositories, however, I haven't found a way to create such hooks for a public repo.
Is it possible in any way?
Yes, you're correct - it seems that it is not possible to subscribe to events of a repository you do not own (using PSHB), or create hooks for such repos.
Perhaps this would be a nice feature request to send to support#github.com.

How to have a private repository with public issue tracker on GitHub?

I am going to release some beta version of my application to the community. Project is stored on GitHub in the private repository.
I would like to allow this community to report bugs and place them directly on GitHub Issues tab - it's not provided by GitHub right now. Do you have any idea, how to cover this flow ?
Not possible as of 2019-09 as documented at: https://help.github.com/articles/issues-only-access-permissions/ (archive):
GitHub does not provide issues-only access permissions, but you can accomplish this using a second repository which contains only the issues.
They suggest that you create a separate public repository just for the issues instead.
Possible same request: Github-like hosting, with private source, public ticketing system
Bitbucket provides this. You can keep the code private but make tracker public (anyone can view, create, and comment on issues).
Use the API access and program some minimal frontend yourself - https://docs.github.com/en/rest/issues

How do I make a readonly mirror of my github repo?

We need to have a read only github repo that mirrors our main branch.
I've noticed castle have managed to do it with their entire collection of repositories.
How would I go about achieving this?
Castleproject is an organization (also mentioned here) in order to restrict write access.
That is why you see read-only addresses on their projects.
That also means it (ie the organization "castleproject") can add users with read-only rights.
As a simple user owning a GitHub repo, you wouldn't have access to that feature.
You need to define an "organization".
I believe this is what you are looking for right here:
http://justcramer.com/2011/05/09/creating-a-one-way-git-server-mirror/