Skip to content

Add simple script to dump org members and teams in wiki format #53

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jimwins
Copy link
Member

@jimwins jimwins commented Aug 23, 2024

No description provided.

@derickr
Copy link
Member

derickr commented Sep 3, 2024

Would it be much work to change this to Markdown format? Right now, that's useless for the wiki, but I'm investigating whether we can support Markdown there, instead of this slightly-awkward dokuwiki format.

It would also be mega useful if it could list which teams have access to which repositories, and perhaps also for each organisation member?

@jimwins
Copy link
Member Author

jimwins commented Sep 3, 2024

Ha, my first version of this script actually output Markdown but I changed it to DokuWiki syntax. Changing it isn't a problem.

I'll look at what repository information it can generate, a problem is that I'm just a regular member of the GH organization so my access is limited. Maybe the API will let me access the information for the repos I do have access to.

I think the way to use this eventually might be in a GitHub Action that runs periodically and commits and pushes the generated files to the systems repo when they change. That would result in diffs being sent to [email protected].

@derickr
Copy link
Member

derickr commented Sep 4, 2024

I think API access will in that case have to be done with a specific token that has access to all of this information. Mine does, but I don't think we should use user tokens to run this script (daily). There is https://github.com/organizations/php/settings/personal-access-tokens-onboarding, but I am not 100% on how all of this works. Perhaps you can investigate on how to do this best too?

@jimwins
Copy link
Member Author

jimwins commented Sep 6, 2024

Okay, switched to Markdown output and now it should print all of the Organization Roles as well as Repositories with their Collaborators (people who have access to that repository). It should list both people with direct access and teams with access.

Not 100% sure this all actually works, since I don't have enough access to the PHP organization to dump the roles and repository members.

For the access token, it looks like there is a way to expose one to this script running as a GitHub Action, but I haven't untangled all that would be required. Looks like it requires creating an "App" for the PHP organization.

https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants