{"id":18155411,"url":"https://github.com/hirosassa/ksnotify","last_synced_at":"2025-05-05T03:00:11.405Z","repository":{"id":46773715,"uuid":"404486375","full_name":"hirosassa/ksnotify","owner":"hirosassa","description":"A CLI command to parse kubectl diff result and notify it to GitLab","archived":false,"fork":false,"pushed_at":"2025-05-04T23:35:07.000Z","size":70,"stargazers_count":10,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-05T03:00:03.096Z","etag":null,"topics":["ci","gitlab","gitlab-ci","kubectl","kustomize","skaffold"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hirosassa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2021-09-08T20:28:30.000Z","updated_at":"2025-05-04T23:35:11.000Z","dependencies_parsed_at":"2024-04-01T21:28:23.351Z","dependency_job_id":"87241c80-e3e3-4e81-8eba-f38743de80f3","html_url":"https://github.com/hirosassa/ksnotify","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirosassa%2Fksnotify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirosassa%2Fksnotify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirosassa%2Fksnotify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirosassa%2Fksnotify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hirosassa","download_url":"https://codeload.github.com/hirosassa/ksnotify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252429931,"owners_count":21746571,"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":["ci","gitlab","gitlab-ci","kubectl","kustomize","skaffold"],"created_at":"2024-11-02T04:10:53.373Z","updated_at":"2025-05-05T03:00:11.385Z","avatar_url":"https://github.com/hirosassa.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ksnotify\n\n[![build](https://github.com/hirosassa/ksnotify/actions/workflows/test.yaml/badge.svg)](https://github.com/hirosassa/ksnotify/actions/workflows/test.yaml)\n[![codecov](https://codecov.io/gh/hirosassa/ksnotify/branch/main/graph/badge.svg?token=IXWXVU95B8)](https://codecov.io/gh/hirosassa/ksnotify)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/hirosassa/ksnotify/blob/main/LICENSE)\n\nA CLI command to parse `kubectl diff` result and notify it to GitLab/GitHub\n\n## What ksnotify does\n\n1. Parse the execution result of `kubectl diff`\n1. Notify it to GitLab/GitHub\n\nThe comment posted by ksnotify is as follows:\n\n------------\n## Plan result\n\n[CI link]( https://example.com )\n\n* updated\n  * apps.v1.Deployment.test.test-app\n\n\u003cdetails\u003e\u003csummary\u003eDetails (Click me)\u003c/summary\u003e\n\n## apps.v1.Deployment.jasmine.test-app\n```diff\n @@ -5,7 +5,6 @@\n     deployment.kubernetes.io/revision: \"3\"\n+  labels:\n+    app: test-app\n   name: test-app\n   namespace: test\n spec:\n@@ -27,7 +26,6 @@\n       creationTimestamp: null\n       labels:\n         app: test-app\n-        skaffold.dev/run-id: 1234\n     spec:\n       containers:\n       - args:\n```\n\u003c/details\u003e\n\n------------\n\n## Install\n\n### GitHub Releases\n\nDownload the prebuilt binary from [GitHub Releases](https://github.com/hirosassa/ksnotify/releases) and install it to $PATH.\n\n### aqua\n\nInstall ksnotify with [aqua](https://aquaproj.github.io/), which is a declarative CLI Version Manager.\n\n```console\n$ aqua g -i hirosassa/ksnotify\n```\n\n## Usage\n### prerequisites\n\n#### For GitLab\n\nCreate and export GitLab access token to environmental variables as follows:\n\n```console\nexport KSNOTIFY_GITLAB_TOKEN=\"xxxxxx\"\n```\nref: [Project access tokens | GitLab](https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html)\n\n#### For GitHub\n\nIf you run `ksnotify` on GitHub Actions, `ksnotify` use `GITHUB_TOKEN` by default.\nIf you run `ksnotify` locally, you should set PAT to `GITHUB_TOKEN`.\n\nref: [Permissions required for fine-grained personal access tokens](https://docs.github.com/en/rest/authentication/permissions-required-for-fine-grained-personal-access-tokens?apiVersion=2022-11-28)\n\n### Post diff results to GitLab/GitHub\n\nBasic usage is as follows:\n\n```console\nskaffold render -p dev | kubectl diff -f - 2\u003e /dev/null | | ksnotify --notifier gitlab --ci gitlab\n```\n\nIf you want to update existing comment instead of create a new comment, you should add `--patch` flag like\n\n```console\nskaffold render -p dev | kubectl diff -f - 2\u003e /dev/null | | ksnotify --notifier gitlab --ci gitlab --patch\n```\n\nTo suppress `skaffold` labels like `skaffold.dev/run-id: 1234` automatically added by `skaffold`, you should add `--suppress-skaffold` flag like\n\n```console\nskaffold render -p dev | kubectl diff -f - 2\u003e /dev/null | | ksnotify --notifier gitlab --ci gitlab --suppress-skaffold\n```\n\nThe concrete example of GitLab CI configuration is shown in [example](https://github.com/hirosassa/ksnotify/tree/main/example).\n\n\n## For developers\n\nTo run `ksnotify` locally, use local option for debug.\nFor local mode, `ksnotify` just renders contents on stdout.\n\n```console\nskaffold render -p dev | kubectl diff -f - 2\u003e /dev/null | path/to/ksnotify --ci local --notifier gitlab --suppress-skaffold\n\n\u003e ## Plan result\n\u003e [CI link](  )\n\u003e\n\u003e * updated\n\u003e blah\n\u003e blah\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhirosassa%2Fksnotify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhirosassa%2Fksnotify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhirosassa%2Fksnotify/lists"}