Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gitlab-report
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tools
gitlab-report
Commits
8944df6d
Commit
8944df6d
authored
1 year ago
by
Sigmund, Dominik
Browse files
Options
Downloads
Patches
Plain Diff
Update file script.py
parent
bc16a608
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
script.py
+3
-3
3 additions, 3 deletions
script.py
with
3 additions
and
3 deletions
script.py
+
3
−
3
View file @
8944df6d
...
@@ -95,10 +95,10 @@ def get_gitlab_version():
...
@@ -95,10 +95,10 @@ def get_gitlab_version():
return
gitlab_version
return
gitlab_version
def
get_gitlab_info
():
def
get_gitlab_info
(
api_token
):
# Replace 'YOUR_GITLAB_URL' and 'YOUR_PRIVATE_TOKEN' with your GitLab URL and private token
# Replace 'YOUR_GITLAB_URL' and 'YOUR_PRIVATE_TOKEN' with your GitLab URL and private token
gl
=
gitlab
.
Gitlab
(
gitlab_url
,
private
_token
)
gl
=
gitlab
.
Gitlab
(
gitlab_url
,
api
_token
)
gl
.
auth
()
gl
.
auth
()
# Get the number of projects
# Get the number of projects
...
@@ -222,7 +222,7 @@ api_token, confluence_token = load_api_token()
...
@@ -222,7 +222,7 @@ api_token, confluence_token = load_api_token()
subject
=
'
Monthly GitLab Report - {month} {year}
'
.
format
(
month
=
datetime
.
datetime
.
now
().
strftime
(
'
%B
'
),
year
=
datetime
.
datetime
.
now
().
strftime
(
'
%Y
'
))
subject
=
'
Monthly GitLab Report - {month} {year}
'
.
format
(
month
=
datetime
.
datetime
.
now
().
strftime
(
'
%B
'
),
year
=
datetime
.
datetime
.
now
().
strftime
(
'
%Y
'
))
# Get GitLab information
# Get GitLab information
num_projects
,
num_users
,
admin_users_list
,
free_space_on_disk
=
get_gitlab_info
()
num_projects
,
num_users
,
admin_users_list
,
free_space_on_disk
=
get_gitlab_info
(
api_token
)
# Compose the email body as a dictionary
# Compose the email body as a dictionary
email_body
=
{
email_body
=
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment