{"id":27040431,"url":"https://github.com/ldb/tfc-badge","last_synced_at":"2025-04-05T03:29:12.295Z","repository":{"id":65661691,"uuid":"371754987","full_name":"ldb/tfc-badge","owner":"ldb","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-09T15:36:27.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T14:22:15.691Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/ldb.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}},"created_at":"2021-05-28T16:09:56.000Z","updated_at":"2024-06-20T14:22:15.692Z","dependencies_parsed_at":"2023-02-03T00:55:14.056Z","dependency_job_id":null,"html_url":"https://github.com/ldb/tfc-badge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldb%2Ftfc-badge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldb%2Ftfc-badge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldb%2Ftfc-badge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldb%2Ftfc-badge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ldb","download_url":"https://codeload.github.com/ldb/tfc-badge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284910,"owners_count":20913691,"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":[],"created_at":"2025-04-05T03:29:11.763Z","updated_at":"2025-04-05T03:29:12.285Z","avatar_url":"https://github.com/ldb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tfc-badge\nCI status badges for [Terraform Cloud](https://www.terraform.io/cloud).\n\n## Overview\n\nThe system is quite simple:\n- On each run, Terraform Cloud informs this server (\"_tfcbd_\") using a [webhook notification](https://www.terraform.io/docs/cloud/workspaces/notifications.html)\n- _tfcbd_ stores the result in memory\n- Upon request, _tfcbd_ renders a status badge that can be embedded into READMEs\n- For each run, _tfcbd_ can publish annotations to Grafana\n\n## Design decisions\n\nThis project is intentionally small and simple and comes with a couple of tradeoffs:\n- **No (necessary) persistence.** If the server is restarted, records of previous runs are lost. \n  _tfcbd_ renders a special \"unknown\" badge in that case. *Note: You can persist state across restarts by providing a \n  file path to the `--file` flag now.*\n    \n- **No scalability.** Running multiple instances of _tfcbd_ may yield wrong results.\n  Honestly though, it should handle even big loads just fine and probably does not need\n  to be highly available either.\n\n## Usage\n\n### Publishing Grafana Annotations\n\nOn each run, _tfcbd_ can publish annotations to Grafana. These annotations are spans for the entire duration of a run.\nThey contain the following tags:\n\n- `tfc-badge`: fixed to allow selecting the right annotations easily\n- `status`: contains the final status of the run, e.g \"applied\"\n- `workspace`: the name of the workspace of the run\n\nIn order to enable the creation of annotation, the `GRAFANA_HOST` and `GRAFANA_API_KEY` environment variables need to be passed (see below).\n\n### Configuration Flags\n\nYou can use the following flags to control the behaviour of `tfcbd`:\n\n```shell\n  -addr string\n        specify the address and port to listen on (default \":3030\")\n  -debug\n        enable debug log output\n  -file string\n        path to file to store persistent cache in\n  -metrics string\n        specify the address and port to listen on for metrics (default \":9080\")\n```\n\n### Environment variables\n\n- `GRAFANA_HOST` can be set to pass the Grafana host (example: `https://grafana.monitoring.local`)\n- `GRAFANA_API_KEY` can be set to pass an API key for Grafana\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fldb%2Ftfc-badge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fldb%2Ftfc-badge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fldb%2Ftfc-badge/lists"}