1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
#+title: GitHub Scripts
*NOTE*: I used the same [[https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens][PAT]] for all scripts within this folder. Note that you can likely reduce permissions for certain scripts - it's best practice to define a PAT for a specific purpose and avoid using a single PAT with broad permissions.
- Personal Access Token:
- [x] Repository Permissions
- [x] Actions: read-only
- [x] Contents: read-only
- [x] Metadata: read-only
- [x] Workflows: read-only
- [x] Organization Permissions
- [x] Administration: read-only
* =github_admins.py=
#+begin_src sh
python ./github_admins.py
#+end_src
#+begin_src text
Members of the organization 'your_organization':
Repositories in the organization 'your_organization':
- demo-repository
Collaborators for the repository 'demo-repository':
- user1: admin
#+end_src
* =github_audit_log.py=
*NOTE*: Requires an active GitHub Enterprise subscription.
#+begin_src sh
python ./github_audit_log.py
#+end_src
#+begin_src text
TODO: Need to get an Enterprise subscription to test this script.
#+end_src
* =github_branch_protections.py=
#+begin_src sh
python ./github_branch_protections.py
#+end_src
#+begin_src text
Total branches in the repository 'demo-repository': 1
Branch: main
No protection settings
Repository rulesets for 'demo-repository':
[{'id': 2311373, 'name': 'default', 'target': 'branch', 'source_type': 'Repository', 'source': 'phryq/demo-repository', 'enforcement': 'active', 'node_id': 'RRS_lACqUmVwb3NpdG9yec40LV1PzgAjRM0', '_links': {'self': {'href': 'https://api.github.com/repos/phryq/demo-repository/rulesets/2311373'}, 'html': {'href': 'https://github.com/phryq/demo-repository/rules/2311373'}}, 'created_at': '2024-10-19T15:59:35.200-05:00', 'updated_at': '2024-10-19T15:59:35.200-05:00'}]
#+end_src
* =github_commits.py=
#+begin_src sh
python ./github_commits.py
#+end_src
#+begin_src text
Total commits in the repository 'demo-repository' on branch 'main': 3
Commit SHA: 13c488a2cdda08e4043f8ef36ced5fdd429e9718
Author: Christian Cleberg <156287552+ccleberg@users.noreply.github.com>
Date: 2024-10-19T20:57:55Z
Message: Merge pull request #2 from phryq/1-test-issue
fixes
URL: https://github.com/phryq/demo-repository/commit/13c488a2cdda08e4043f8ef36ced5fdd429e9718
Files changed:
- .gitignore (added)
Additions: 0, Deletions: 0, Changes: 0
- README.md (removed)
Additions: 0, Deletions: 4, Changes: 4
- README.org (added)
Additions: 7, Deletions: 0, Changes: 7
Commit SHA: 6bfde238a2a34a93ce8ee02082eaf4ab3c189368
Author: Christian Cleberg <hello@cmc.pub>
Date: 2024-10-19T20:56:50Z
Message: fixes
URL: https://github.com/phryq/demo-repository/commit/6bfde238a2a34a93ce8ee02082eaf4ab3c189368
Files changed:
- .gitignore (added)
Additions: 0, Deletions: 0, Changes: 0
- README.md (removed)
Additions: 0, Deletions: 4, Changes: 4
- README.org (added)
Additions: 7, Deletions: 0, Changes: 7
Commit SHA: be1ddf31e08fc790f54d68f8067b7b2f3805f999
Author: Christian Cleberg <156287552+ccleberg@users.noreply.github.com>
Date: 2024-10-19T20:54:08Z
Message: Initial commit
URL: https://github.com/phryq/demo-repository/commit/be1ddf31e08fc790f54d68f8067b7b2f3805f999
Files changed:
- .github/workflows/auto-assign.yml (added)
Additions: 19, Deletions: 0, Changes: 19
- .github/workflows/proof-html.yml (added)
Additions: 11, Deletions: 0, Changes: 11
- README.md (added)
Additions: 4, Deletions: 0, Changes: 4
- index.html (added)
Additions: 1, Deletions: 0, Changes: 1
- package.json (added)
Additions: 9, Deletions: 0, Changes: 9
#+end_src
|