{"id":40811045,"url":"https://github.com/wwwlde/approveguard","last_synced_at":"2026-01-21T21:17:20.797Z","repository":{"id":192310462,"uuid":"686455390","full_name":"wwwlde/approveguard","owner":"wwwlde","description":"ApproveGuard: A CLI tool for enforcing upvote thresholds on GitLab Community Edition merge requests, designed to integrate seamlessly into Atlantis workflows.","archived":false,"fork":false,"pushed_at":"2025-06-24T00:14:26.000Z","size":372,"stargazers_count":22,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-24T01:24:39.928Z","etag":null,"topics":["approve","atlantis","gitlab-ce","golang","terraform","upvotes","workflows"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wwwlde.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-09-02T21:11:59.000Z","updated_at":"2025-06-24T00:12:21.000Z","dependencies_parsed_at":"2025-02-08T05:45:10.300Z","dependency_job_id":null,"html_url":"https://github.com/wwwlde/approveguard","commit_stats":null,"previous_names":["wwwlde/approveguard"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/wwwlde/approveguard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwwlde%2Fapproveguard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwwlde%2Fapproveguard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwwlde%2Fapproveguard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwwlde%2Fapproveguard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wwwlde","download_url":"https://codeload.github.com/wwwlde/approveguard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwwlde%2Fapproveguard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28643298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T18:04:35.752Z","status":"ssl_error","status_checked_at":"2026-01-21T18:03:55.054Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["approve","atlantis","gitlab-ce","golang","terraform","upvotes","workflows"],"created_at":"2026-01-21T21:17:19.801Z","updated_at":"2026-01-21T21:17:20.787Z","avatar_url":"https://github.com/wwwlde.png","language":"Go","readme":"# 🚪🔒🗝️ ApproveGuard\n\n\u003e ⭐️⭐️⭐️ If you find this project useful, please consider giving it a star on GitHub. This helps draw attention to the project and encourages ongoing development. Thank you!\n\n## Overview\n\nThis CLI tool checks the number of upvotes for a GitLab Merge Request (MR). It is designed to run within an Atlantis workflow and aims to fill the gap in features between GitLab Community Edition and the Enterprise Edition.\n\nThe CLI tool takes three parameters:\n\n1. GitLab Token\n2. Merge Request URL\n3. Upvotes Threshold\n\nIt returns an exit code of `0` if the number of upvotes meets or exceeds the specified threshold, and `1` otherwise.\n\n### GitLab Community Edition?\n\nGitLab Community Edition is an open-source platform that provides a wide array of baseline features for version control and project management. However, certain enterprise-level features like multiple approvers are not available in the CE version. This CLI tool aims to supplement that functionality by providing an automated way to check for upvotes on Merge Requests.\n\n## 🌟 Features\n\n- Check the upvote count for a specific Merge Request\n- Customize the upvote threshold to suit your project needs\n- Written in Go for cross-platform compatibility\n\n## Requirements\n\n- Go 1.21\n- Atlantis 0.19.X\n- GitLab API Token with `read_api` access level\n\n## 🚀 Installation\n\nTo build the project, run:\n\n```\nCGO_ENABLED=0 go build -o ./ApproveGuard --ldflags '-w -s -extldflags \"-static\"' .\n```\n\n## ⚙ Options\n\n- `--token`: GitLab API token (can also be set via `GITLAB_TOKEN` environment variable)\n- `--upvotes`: The minimum required upvotes (can also be set via `UPVOTES` environment variable)\n- `--url`: The Merge Request URL (can also be set via `PULL_URL` environment variable)\n- `--pull-num`: The Merge Request ID (can also be set via `PULL_NUM` environment variable)\n\n## ▶️ Running\n\n```bash\n$ export GITLAB_TOKEN=glpat-XXX\n$ export PULL_NUM=1\n$ export PULL_URL=https://gitlab.example.com/denys.lemeshko/downstream/-/merge_requests/1\n$ ./ApproveGuard -h\nCheck upvotes for a GitLab MR\n\nUsage:\n  ApproveGuard [flags]\n\nFlags:\n  -h, --help           help for BlockMaster\n      --pull-num int   Merge request ID (or set PULL_NUM env var) (default 1)\n      --token string   GitLab token (or set GITLAB_TOKEN env var) (default \"glpat-XXX\")\n      --upvotes int    Upvote threshold (or set UPVOTES env var) (default 1)\n      --url string     Merge request URL (or set PULL_URL env var) (default \"https://gitlab.example.com/denys.lemeshko/downstream/-/merge_requests/1\")\n  -v, --version        version for BlockMaster\n```\n\n👍\n\n```bash\n$ ./ApproveGuard\n2023/09/02 04:29:47 Numeric Project ID: 91\n2023/09/02 04:29:47 Merge request Author: Denys Lemeshko (denys.lemeshko)\n2023/09/02 04:29:47 Merge request has sufficient upvotes.\n$ echo $?\n0\n```\n\n👎\n\n```bash\n$ ./ApproveGuard\n2023/09/02 04:30:07 Numeric Project ID: 91\n2023/09/02 04:30:08 Merge request Author: Denys Lemeshko (denys.lemeshko)\n2023/09/02 04:30:08 Merge request has insufficient upvotes.\n$ echo $?\n1\n```\n\n![Atlantis](./atlantis.png)\n\n---\n\n## Atlantis configuration example\n\n`docker-compose.yaml`\n\n```yaml\nversion: \"3.8\"\n\nnetworks:\n  traefik-public:\n    external: true\n\nservices:\n  atlantis:\n    container_name: atlantis\n    image: registry.example.com/docker/atlantis:v0.0.2-d97e6784\n    restart: unless-stopped\n    logging:\n        driver: \"json-file\"\n        options:\n            max-file: 5\n            max-size: 10m\n    expose:\n      - \"4141\"\n    command:\n      - 'server'\n      - '--atlantis-url=https://atlantis.example.com'\n      - '--gitlab-webhook-secret=XXX'\n      - '--gitlab-user=git'\n      - '--repo-allowlist=gitlab.example.com/devops/terraform/*'\n      - '--repo-config=/data/repos.yaml'\n      - '--write-git-creds'\n    volumes:\n      - ./repos.yaml:/data/repos.yaml\n    networks:\n      - traefik-public\n    environment:\n      - \"UPVOTES=2\"\n      - \"ATLANTIS_GITLAB_HOSTNAME=gitlab.example.com\"\n      - \"ATLANTIS_GITLAB_TOKEN=glpat-XXX\"\n    labels:\n      # Explicitly tell Traefik to expose this container\n      - \"traefik.enable=true\"\n      # HTTPS Atlantis\n      - \"traefik.http.routers.atlantis-web-secure.rule=Host(`atlantis.example.com`)\"\n      - \"traefik.http.routers.atlantis-web-secure.tls=true\"\n      - \"traefik.http.routers.atlantis-web-secure.tls.certresolver=myresolver\"\n      - \"traefik.http.routers.atlantis-web-secure.entrypoints=websecure\"\n      - \"traefik.http.routers.atlantis-web-secure.middlewares=robots-tag-header@file,atlantis-auth\"\n      - \"traefik.http.routers.atlantis-web-secure.service=atlantis-web-secure\"\n      - \"traefik.http.services.atlantis-web-secure.loadbalancer.server.port=4141\"\n      - \"traefik.http.services.atlantis-web-secure.loadbalancer.server.scheme=http\"\n      - \"traefik.http.middlewares.atlantis-auth.basicauth.users=lde:XXX\"\n```\n\n`repos.yaml`\n\n```yaml\nrepos:\n  - id: /.*/\n    apply_requirements:\n      - approved\n      - mergeable\n    workflow: terragrunt\nworkflows:\n  terragrunt:\n    plan:\n      steps:\n      - run: echo \"Run \\\"terraform fmt\\\" command\" \u0026\u0026 terraform fmt -check -diff\n      - env:\n          name: TERRAGRUNT_TFPATH\n          command: \"echo terraform$ATLANTIS_TERRAFORM_VERSION\"\n      - run: bash -o pipefail -c \"terragrunt plan -no-color -out=${PLANFILE}\"\n    apply:\n      steps:\n      - run: ApproveGuard --token $ATLANTIS_GITLAB_TOKEN --pull-num $PULL_NUM --upvotes 2 --url https://${ATLANTIS_GITLAB_HOSTNAME}/${BASE_REPO_OWNER}/${BASE_REPO_NAME}/-/merge_requests/${PULL_NUM}\n      - env:\n          name: TERRAGRUNT_TFPATH\n          command: 'echo terraform$ATLANTIS_TERRAFORM_VERSION'\n      - run: bash -o pipefail -c \"terragrunt apply -no-color ${PLANFILE}\"\n```\n\n## 🤝 Contributing\n\nContributions to this project are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details.\n\n## 📜 License\n\nThis project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwwwlde%2Fapproveguard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwwwlde%2Fapproveguard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwwwlde%2Fapproveguard/lists"}