{"id":30176252,"url":"https://github.com/itsgitz/gh-push-vars","last_synced_at":"2026-01-20T17:30:46.001Z","repository":{"id":304568175,"uuid":"1010952171","full_name":"itsgitz/gh-push-vars","owner":"itsgitz","description":"Push secrets and variables from your .env file to your GitHub repository using the GitHub REST API — without the need for GitHub CLI.","archived":false,"fork":false,"pushed_at":"2025-07-15T08:17:44.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-15T17:38:03.001Z","etag":null,"topics":["bun","environment","environment-variables","github","github-actions","node","nodejs","secrets","variables"],"latest_commit_sha":null,"homepage":"http://github.com/itsgitz/gh-push-vars","language":"TypeScript","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/itsgitz.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":"2025-06-30T04:57:02.000Z","updated_at":"2025-07-15T08:17:47.000Z","dependencies_parsed_at":"2025-07-15T18:52:31.917Z","dependency_job_id":null,"html_url":"https://github.com/itsgitz/gh-push-vars","commit_stats":null,"previous_names":["itsgitz/gh-push-env","itsgitz/gh-push-vars"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/itsgitz/gh-push-vars","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsgitz%2Fgh-push-vars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsgitz%2Fgh-push-vars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsgitz%2Fgh-push-vars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsgitz%2Fgh-push-vars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itsgitz","download_url":"https://codeload.github.com/itsgitz/gh-push-vars/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsgitz%2Fgh-push-vars/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269991455,"owners_count":24509009,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bun","environment","environment-variables","github","github-actions","node","nodejs","secrets","variables"],"created_at":"2025-08-12T02:44:42.310Z","updated_at":"2025-12-30T21:47:12.610Z","avatar_url":"https://github.com/itsgitz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gh-push-vars\n\n[![npm](https://img.shields.io/npm/v/gh-push-vars)](https://www.npmjs.com/package/gh-push-vars)\n[![license](https://img.shields.io/npm/l/gh-push-vars)](https://opensource.org/licenses/MIT)\n[![bun](https://img.shields.io/badge/bun-compatible-blue)](https://bun.sh)\n\nPush secrets and variables from your `.env` file to your **GitHub repository** using the GitHub REST API — without the need for GitHub CLI.\n\n\u003e I was tired of manually adding GitHub Actions secrets and variables, so I built this tool to automate the process for personal use. 😞\n\n![Secrets Example](https://raw.githubusercontent.com/itsgitz/gh-push-vars/master/docs/img/secrets.png \"Secrets Example\")\n\n![Variables Example](https://raw.githubusercontent.com/itsgitz/gh-push-vars/master/docs/img/vars.png \"Variables Example\")\n\n---\n\n## Features\n\n- Push **repository secrets** via `GH_SECRET_\u003cname\u003e`\n- Push **repository variables** via `GH_VAR_\u003cname\u003e`\n- Automatically normalizes variable names to lowercase\n- Built with Octokit and Bun\n\n\u003e GitHub Actions environments (e.g. staging, production) are **not supported yet** — coming in the next phase!\n\n---\n\n## Install\n\n```bash\nnpx gh-push-vars           # Recommended\nbunx gh-push-vars          # If using Bun\nnpm install -g gh-push-vars # Optional global install\n\n```\n\n---\n\n## Usage\n\n```bash\ngh-push-vars\n\n# With custom env file path\ngh-push-vars --env-file=.env.local\ngh-push-vars -e .env.local\n```\n\nThe script will:\n\n- Automatically detects all keys starting with `GH_SECRET_` or `GH_VAR_`\n- Converts the names to lowercase\n- Uploads them to your GitHub repository\n\n---\n\n## .env Format\n\n```bash\n# Required\nGITHUB_TOKEN=\"ghp_...\"\nGITHUB_OWNER=\"your-org\"\nGITHUB_REPO=\"your-repo\"\n\n# Repository-level secrets\nGH_SECRET_API_KEY=\"abcd1234\"\nGH_SECRET_PASSWORD=\"supersecret\"\n\n# Repository-level variables\nGH_VAR_DEBUG=true\nGH_VAR_TIMEOUT=5000\n\n\n```\n\n---\n\n## Prefix Guide\n\n| .env Key Prefix    | Type                | Target      | Resulting GitHub Name |\n| ------------------ | ------------------- | ----------- | --------------------- |\n| `GH_SECRET_\u003cname\u003e` | Repository Secret   | Repo Secret | `name` in lowercase   |\n| `GH_VAR_\u003cname\u003e`    | Repository Variable | Repo Var    | `name` in lowercase   |\n\n\u003e Example: `GH_SECRET_API_KEY` becomes GitHub secret `api_key` \u003e `GH_VAR_DEBUG_MODE` becomes variable `debug_mode`\n\n## Required GitHub Token Scopes\n\nYour `GITHUB_TOKEN` must have the following scopes:\n\n- `repo`\n- `actions`\n\nThese are required to manage repository-level secrets and variables via GitHub’s REST API.\n\n## Development\n\n```bash\nbun install\nbun run src/index.ts\n\n```\n\n### Build CLI\n\n```bash\nbun build src/index.ts --outdir dist --target bun\nchmod +x dist/index.js\n\n```\n\n## Pre-publish to npm\n\n```json\n\"files\": [\"dist\"],\n\"bin\": {\n  \"gh-push-vars\": \"dist/index.js\"\n},\n\"scripts\": {\n  \"build\": \"bun build src/index.ts --outdir dist --target bun\",\n  \"prepublishOnly\": \"bun run build\"\n}\n\n```\n\n## Roadmap\n\n- [x] Repo secrets support\n- [x] Repo variables support\n- [x] Name normalization to lowercase\n- [x] Add support for custom `env` file option\n- [ ] Publish the package to NPM\n- [ ] Environment-level secrets/variables (`GH_ENV_SECRET_` / `GH_ENV_VAR_`)\n- [ ] `--dry-run` preview mode\n- [ ] Support for `.env.[mode]`\n- [ ] Config file (`gh-push-vars.json`)\n- [ ] Interactive mode\n\n## License\n\nMIT © 2025 Anggit M Ginanjar\n\n\n\u003c!-- Security scan triggered at 2025-09-02 00:28:56 --\u003e\n\n\u003c!-- Security scan triggered at 2025-09-09 05:28:04 --\u003e\n\n\u003c!-- Security scan triggered at 2025-09-28 15:30:51 --\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsgitz%2Fgh-push-vars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsgitz%2Fgh-push-vars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsgitz%2Fgh-push-vars/lists"}