{"id":24350153,"url":"https://github.com/alexbsrd/gitlab-tools","last_synced_at":"2025-12-25T13:45:12.418Z","repository":{"id":272978351,"uuid":"918335733","full_name":"AlexBsrd/gitlab-tools","owner":"AlexBsrd","description":"A collection of shell scripts to automate and streamline GitLab project management tasks.","archived":false,"fork":false,"pushed_at":"2025-01-17T19:12:26.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T20:24:06.232Z","etag":null,"topics":["gitlab","gitlab-api"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlexBsrd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-17T18:07:28.000Z","updated_at":"2025-01-17T19:13:52.000Z","dependencies_parsed_at":"2025-01-17T20:24:09.962Z","dependency_job_id":"c882f075-3284-44a7-99dc-fa5e29b06de0","html_url":"https://github.com/AlexBsrd/gitlab-tools","commit_stats":null,"previous_names":["alexbsrd/gitlab-tools"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexBsrd%2Fgitlab-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexBsrd%2Fgitlab-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexBsrd%2Fgitlab-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexBsrd%2Fgitlab-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexBsrd","download_url":"https://codeload.github.com/AlexBsrd/gitlab-tools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243150477,"owners_count":20244396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gitlab","gitlab-api"],"created_at":"2025-01-18T13:27:21.820Z","updated_at":"2025-12-25T13:45:12.410Z","avatar_url":"https://github.com/AlexBsrd.png","language":"Shell","readme":"# GitLab Tools 🛠️\n\nA collection of shell scripts to automate and streamline GitLab project management tasks. These tools help you monitor merge requests, track project activity, analyze contributions, and measure job performance.\n\n## 📋 Requirements\n\n- `bash` shell\n- `curl` for API requests\n- `jq` for JSON processing\n- GitLab personal access token with appropriate permissions\n\n## 🔧 Configuration\n\nAll scripts use environment variables for configuration.\n\n**Required for all scripts:**\n```bash\nexport GITLAB_URL=\"https://your-gitlab-instance.com\"\nexport GITLAB_TOKEN=\"your-personal-access-token\"\n```\n\n## 🚀 Available Scripts\n\n### Pipeline Monitor\n\nReal-time monitoring dashboard for pipeline statuses across all projects in a GitLab group.\n\n```bash\n# Basic usage - show only non-successful pipelines\n./pipeline-monitor.sh GROUP_ID\n\n# Show all pipelines including successful ones\nSHOW_SUCCESSFUL=true ./pipeline-monitor.sh GROUP_ID\n\n# Auto-refresh every 30 seconds\nREFRESH=30 ./pipeline-monitor.sh GROUP_ID\n```\n\n**Additional configuration:**\n```bash\nexport GROUP_ID=\"123\"                # Required\nexport SHOW_SUCCESSFUL=\"true\"        # Optional (default: false)\nexport REFRESH=\"30\"                  # Optional (refresh interval in seconds)\nexport DEBUG=\"true\"                  # Optional (enables debug logging)\n```\n\nFeatures:\n- Color-coded status indicators (✓ Success, ✗ Failed, ⟳ Running, ⋯ Pending, ⊙ Manual)\n- Auto-refresh capability\n- Compact project name display\n- Summary statistics\n- Configurable display of successful pipelines\n\n### Merge Requests Automator\n\nAutomates merge request workflows by monitoring approvals, managing labels, and sending notifications.\n\n```bash\n# Process all merge requests\n./merge-requests-automator.sh\n\n# Process a specific merge request\n./merge-requests-automator.sh PROJECT_ID MR_IID\n```\n\n**Additional configuration:**\n```bash\nexport GROUP_ID=\"123\"                              # Required\nexport APPROVAL_THRESHOLD=\"2\"                      # Optional (default: 2)\nexport APPROVAL_LABEL=\"double-approved\"            # Optional\nexport READY_TO_MERGE_LABEL=\"ready-to-be-merged\"  # Optional\nexport BOT_USERNAME=\"gitlab-bot\"                  # Optional\n```\n\n### Personal Contributions\n\nGenerates a detailed Markdown report of a user's merge request contributions.\n\n```bash\n./personal-contributions.sh USERNAME\n```\n\n**Additional configuration:**\n```bash\nexport GROUP_ID=\"123\"                    # Required\nexport MONTHS=\"6\"                        # Optional (default: 6)\nexport OUTPUT_FILE=\"contributions.md\"    # Optional\n```\n\n### Merge Requests Stats\n\nAnalyzes merge request approval statistics and generates reviewer participation reports.\n\n```bash\n./merge-requests-stats.sh\n```\n\n**Additional configuration:**\n```bash\nexport GROUP_ID=\"123\"                            # Required\nexport MONTHS=\"3\"                                # Optional (default: 3)\nexport EXCLUDE_BOTS=\"gitlab-bot\"    # Optional\n```\n\n### Project Activity Tracker\n\nTracks project activity based on merge request history and ranks projects by activity level.\n\n```bash\n./project-activity-tracker.sh\n```\n\n**Additional configuration:**\n```bash\nexport GROUP_ID=\"123\"                    # Required\nexport MONTHS=\"3\"                        # Optional (default: 3)\nexport EXCLUDE_BOTS=\"bot1 bot2\"         # Optional\n```\n\n### Project Lister\n\nLists all projects in a GitLab group, including those in subgroups. Outputs clone URLs for easy access.\n\n```bash\n./project-lister.sh GROUP_ID\n```\n\n### Job Duration Analyzer\n\nCalculate cumulative execution time of a specific job across all pipelines in a given period.\n\n```bash\n# Analyze a specific job for last month\nGITLAB_TOKEN=glpat-xxx PROJECT_ID=123 JOB_NAME=fail-draft-mr ./gitlab-job-duration.sh\n\n# Analyze for a custom period\nGITLAB_TOKEN=glpat-xxx PROJECT_ID=123 JOB_NAME=build \\\n  START_DATE=2024-09-01 END_DATE=2024-09-30 \\\n  ./gitlab-job-duration.sh\n```\n\n**Additional configuration:**\n```bash\nexport PROJECT_ID=\"123\"                  # Required\nexport JOB_NAME=\"job-name\"              # Required\nexport START_DATE=\"2024-09-01\"          # Optional (default: beginning of last month)\nexport END_DATE=\"2024-09-30\"            # Optional (default: end of last month)\n```\n\nFeatures:\n- Searches across all branches and pipeline statuses\n- Displays detailed job information (duration, status, branch, date)\n- Calculates total and average execution times\n- Supports custom date ranges\n\n## 📝 Examples\n\n### Monitor Pipeline Statuses\n```bash\n# Monitor pipelines with auto-refresh\nexport GITLAB_URL=\"https://gitlab.company.com\"\nexport GITLAB_TOKEN=\"your-token\"\nexport GROUP_ID=\"123\"\nexport REFRESH=\"30\"\n./pipeline-monitor.sh\n```\n\n### Generate Your Monthly Contributions Report\n```bash\nexport GITLAB_URL=\"https://gitlab.company.com\"\nexport GITLAB_TOKEN=\"your-token\"\nexport GROUP_ID=\"123\"\nexport MONTHS=\"1\"\n./personal-contributions.sh your-username\n```\n\n### Monitor Active Projects\n```bash\nexport GITLAB_URL=\"https://gitlab.company.com\"\nexport GITLAB_TOKEN=\"your-token\"\nexport GROUP_ID=\"123\"\nexport EXCLUDE_BOTS=\"gitlab-bot\"\n./project-activity-tracker.sh\n```\n\n### Analyze Job Performance\n```bash\nexport GITLAB_URL=\"https://gitlab.company.com\"\nexport GITLAB_TOKEN=\"your-token\"\nexport PROJECT_ID=\"456\"\nexport JOB_NAME=\"test\"\n./gitlab-job-duration.sh\n```\n\n### Clone All Group Projects\n```bash\nexport GITLAB_URL=\"https://gitlab.company.com\"\nexport GITLAB_TOKEN=\"your-token\"\n./project-lister.sh 123 | while read url; do\n    git clone \"$url\"\ndone\n```\n\n## 🔍 Help\n\nAll scripts support the `--help` flag which displays detailed usage information:\n```bash\n./script-name.sh --help\n```\n\n## 📌 Notes\n\n- Scripts are designed to be non-destructive and read-only\n- API pagination is handled automatically\n- All timestamps are in UTC\n\n## 🤝 Contributing\n\nContributions are welcome! Feel free to open issues or submit pull requests to improve these tools.\n\n## 📄 License\n\nThis project is open source and available under the MIT License.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexbsrd%2Fgitlab-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexbsrd%2Fgitlab-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexbsrd%2Fgitlab-tools/lists"}