{"id":13532261,"url":"https://github.com/unfor19/githubsecrets","last_synced_at":"2025-04-11T05:22:21.351Z","repository":{"id":48293484,"uuid":"249570110","full_name":"unfor19/githubsecrets","owner":"unfor19","description":"Manage your GitHub Actions secrets with a simple CLI","archived":false,"fork":false,"pushed_at":"2024-05-29T07:53:37.000Z","size":1272,"stargazers_count":42,"open_issues_count":20,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-29T20:33:42.964Z","etag":null,"topics":["cli","docker","github","github-actions","github-secret","python","secrets"],"latest_commit_sha":null,"homepage":"https://meirg.co.il","language":"Python","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/unfor19.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}},"created_at":"2020-03-23T23:52:53.000Z","updated_at":"2024-06-19T11:47:30.183Z","dependencies_parsed_at":"2023-01-28T10:30:46.935Z","dependency_job_id":"9bf63c61-8b28-486b-a992-45af923fc041","html_url":"https://github.com/unfor19/githubsecrets","commit_stats":{"total_commits":106,"total_committers":4,"mean_commits":26.5,"dds":"0.19811320754716977","last_synced_commit":"6ad276bee961dd422dd641e64764adda886f60a8"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfor19%2Fgithubsecrets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfor19%2Fgithubsecrets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfor19%2Fgithubsecrets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfor19%2Fgithubsecrets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unfor19","download_url":"https://codeload.github.com/unfor19/githubsecrets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248346360,"owners_count":21088445,"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":["cli","docker","github","github-actions","github-secret","python","secrets"],"created_at":"2024-08-01T07:01:09.523Z","updated_at":"2025-04-11T05:22:21.332Z","avatar_url":"https://github.com/unfor19.png","language":"Python","readme":"# githubsecrets\n\n[![testing](https://github.com/unfor19/githubsecrets/workflows/testing/badge.svg)](https://github.com/unfor19/githubsecrets/actions?query=workflow%3Atesting)\n\n\u003cimg width=\"100%\" alt=\"GithubSecrets-Website\" src=\"https://githubsecrets.s3-eu-west-1.amazonaws.com/githubsecrets-website-gradient.png\" /\u003e\n\nManage your [GitHub Actions](https://github.com/features/actions) secrets, with a simple CLI\n\n\u003cdetails\u003e\u003csummary\u003e\nGIF Demo\n\u003c/summary\u003e\n \n![Usage-Demo](https://githubsecrets.s3-eu-west-1.amazonaws.com/githubsecrets-demo.gif)\n\n\u003c/details\u003e\n\n## Installation\n\n### pip\n\nPython v3.6.7 and above\n\nInstall with pip on your machine; the package is available at [PyPi](https://pypi.org/project/githubsecrets/)\n\n```bash\n$ pip install githubsecrets\n```\n\n### From source\n\nPython v3.6.7 and above\n\n1. Clone this repository\n1. Run the `githubsecrets` module (directory)\n   ```\n   python -m githubsecrets --help\n   ```\n\n### Docker\n\n\u003cdetails\u003e\u003csummary\u003eExpand/Collapse\n \u003c/summary\u003e\n\nMount a local directory to `/app`, the image is available at [DockerHub](https://hub.docker.com/r/unfor19/githubsecrets)\n\n#### Linux and macOS\n\nMount your home directory, or any other directory to save the credentials file\n\n```bash\n$ docker run --rm -it -v \"${HOME}/:/app/\" unfor19/githubsecrets secret-list -p unfor19 -r githubsecrets\n... # Output below\n```\n\n\u003cdetails\u003e\u003csummary\u003eOutput\n\u003c/summary\u003e\n\n```json\n[\n  {\n    \"base_url\": \"https://api.github.com/repos/unfor19/githubsecrets\",\n    \"body\": {\n      \"secrets\": [\n        {\n          \"created_at\": \"2020-04-11T00:01:12Z\",\n          \"name\": \"PIP_PASSWORD\",\n          \"updated_at\": \"2020-04-11T00:17:39Z\"\n        },\n        {\n          \"created_at\": \"2020-04-10T23:21:28Z\",\n          \"name\": \"PIP_USERNAME\",\n          \"updated_at\": \"2020-04-11T00:17:20Z\"\n        },\n        {\n          \"created_at\": \"2020-04-27T20:44:09Z\",\n          \"name\": \"testing\",\n          \"updated_at\": \"2020-04-27T20:45:43Z\"\n        },\n        {\n          \"created_at\": \"2020-04-27T20:22:37Z\",\n          \"name\": \"testrepos\",\n          \"updated_at\": \"2020-04-27T20:22:37Z\"\n        },\n        {\n          \"created_at\": \"2020-04-14T14:14:44Z\",\n          \"name\": \"TEST_GITHUB_TOKEN\",\n          \"updated_at\": \"2020-04-14T14:14:44Z\"\n        }\n      ],\n      \"total_count\": 5\n    },\n    \"repository\": \"githubsecrets\",\n    \"status_code\": 200\n  }\n]\n```\n\n\u003c/details\u003e\n\n#### Windows\n\nMount your Temp directory, or any other directory to save the credentials file. Make sure you use `/` and not `\\`\n\n```\n$ docker run --rm -it -v c:/Temp:/app/ unfor19/githubsecrets secret-delete -p unfor19 -r githubsecrets -s testrepos\n... # Output below\n```\n\n\u003cdetails\u003e\u003csummary\u003eOutput\n\u003c/summary\u003e\n\n```json\n[\n  {\n    \"base_url\": \"https://api.github.com/repos/unfor19/githubsecrets\",\n    \"repository\": \"githubsecrets\",\n    \"secret_name\": \"testrepos\",\n    \"status_code\": 204\n  }\n]\n```\n\n\u003c/details\u003e\n\n\u003c/details\u003e\n\n## Getting Started\n\n**Note**: When using Docker, no need to add `ghs`; supply only a command and its arguments\n\n1. Initialize this application - Creates a credentials file at `~/.githubsecrets/credentials`\n\n   ```bash\n   $ ghs init\n   ```\n\n1. [Generate a GitHub Personal-Access-Token](https://github.com/settings/tokens) with the following permissions:\n\n   - repo (all)\n   - admin:public_key \u003e read:public_key\n\n1. Save the token in a safe place; we'll use it in the next step\n\n1. Create a profile, use the `-p` flag and supply a profile name\n\n   ```bash\n   $ ghs profile-apply -p willy_wonka\n   ...\n   SUCCESS: Applied the profile willy_wonka\n   ```\n\n   You'll be prompted to insert:\n\n   - Github owner - which is your GitHub Organization or GitHub Account name (not email address)\n   - Personal access token - that you've created in the previous steps\n\n1. Create a GitHub secret, use the `-r` flag and supply the repository's name. You can apply the same secret to multiple repositories at once, for example: `-r \"githubsecrets, aws-build-badges\"`\n\n   ```bash\n   ghs secret-apply -p willy_wonka -r githubsecrets\n   ```\n\n   You'll be prompted to insert:\n\n   - Secret name\n   - Secret value\n\n1. Use it in your [GitHub Actions Workflows](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions)\n   - Snippet\n     ```yml\n     steps:\n      - uses: actions/checkout@v2\n      - name: Set up Python\n        uses: actions/setup-python@v1\n        with:\n          python-version: \"3.6\"\n      - name: Install dependencies\n        run: |\n          ...\n      - name: Build and publish\n        env:\n          TWINE_USERNAME: ${{ secrets.PIP_USERNAME }}\n          TWINE_PASSWORD: ${{ secrets.PIP_PASSWORD }}\n          ...\n        run: |\n          ...\n     ```\n   - I'm using secrets in this repository, check out [this repository's workflows](https://github.com/unfor19/githubsecrets/tree/master/.github/workflows)\n\n### Status codes\n\n- 200 - success\n- 204 - success\n- 404 - secret or repository not found\n\n### Available commands\n\nView all available commands with `ghs --help`\n\n```\nUsage: ghs [OPTIONS] COMMAND [ARGS]...\n\n  All commands can run without providing options, and then you'll be\n  prompted to insert values.\n\n  Secrets' values and Personal-Access-Tokens are hidden when prompted\n\nOptions:\n  -ci, --ci  Use this flag to avoid deletion confirmation prompts\n  --help     Show this message and exit.\n\nCommands:\n  init            Create a credentials file to store your profiles\n  profile-apply   Create or modify multiple profiles providing a string...\n  profile-delete  Delete multiple profiles providing a string delimited by...\n  profile-list    List all profile - truncates personal access tokens\n  secret-apply    Apply to multiple repositories providing a string...\n  secret-delete   Delete secrets from multiple repositories providing a...\n  secret-get      Get secrets from multiple repositories providing a string...\n  secret-list     List secrets of multiple repositories providing a string...\n```\n\n## Troubleshooting\n\n### Ubuntu and Debian\n\nThis project uses the [keyring](https://pypi.org/project/keyring/) package, in some versions of Ubuntu and Debian, you might need to install the following packages\n\n```\n$ sudo apt-get update \u0026\u0026 sudo apt-get install -y libdbus-glib-1-dev\n$ pip install secretstorage dbus-python keyring\n```\n\n## Contributing\n\nReport issues/questions/feature requests on the [Issues](https://github.com/unfor19/githubsecrets/issues) section.\n\nPull requests are welcome! Ideally, create a feature branch and issue for every single change you make. These are the steps:\n\n1. Fork this repo\n1. Create your feature branch from master (`git checkout -b my-new-feature`)\n1. Install from source\n   ```bash\n    $ git clone https://github.com/${GITHUB_OWNER}/githubsecrets.git \u0026\u0026 cd githubsecrets\n    ...\n    $ pip install --upgrade pip\n    ...\n    $ python -m venv ./ENV\n    $ . ./ENV/bin/activate\n    ...\n    $ (ENV) pip install --editable .\n    ...\n    # Done! Now when you run 'ghs' it will get automatically updated when you modify the code\n   ```\n1. Add the code of your new feature\n1. Test - generate a Personal Access Token for testing\n   ```bash\n   $ (ENV) bash scripts/test_functionality.sh -p PROFILE_NAME -o GITHUB_OWNER -t TEST_GITHUB_TOKEN -r GITHUB_REPOSITORY\n   ... # All good? Move on to the next step\n   ```\n1. Commit your remarkable changes (`git commit -am 'Added new feature'`)\n1. Push to the branch (`git push --set-up-stream origin my-new-feature`)\n1. Create a new Pull Request and tell us about your changes\n\n## Authors\n\nCreated and maintained by [Meir Gabay](https://github.com/unfor19)\n\nDesign by [facebook.com/KerenOrDesign](https://facebook.com/KerenOrDesign)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/unfor19/githubsecrets/blob/master/LICENSE) file for details\n","funding_links":[],"categories":["Python","Community Resources"],"sub_categories":["Static Analysis"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funfor19%2Fgithubsecrets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funfor19%2Fgithubsecrets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funfor19%2Fgithubsecrets/lists"}