All Projects → unfor19 → githubsecrets

unfor19 / githubsecrets

Licence: MIT license
Manage your GitHub Actions secrets with a simple CLI

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to githubsecrets

actions
Load secrets into GitHub Actions
Stars: ✭ 47 (+14.63%)
Mutual labels:  secrets, github-actions
ok-to-test
Example workflow configuration showing how to use GitHub Actions secrets in pull requests from forks 🍴🔑
Stars: ✭ 58 (+41.46%)
Mutual labels:  secrets, github-actions
actions
A Collection of GitHub Actions
Stars: ✭ 91 (+121.95%)
Mutual labels:  secrets, github-actions
18-comic-finder
禁漫天堂Github Actions下载器🧘
Stars: ✭ 264 (+543.9%)
Mutual labels:  github-actions
resource-translator
A GitHub Action that automatically creates machine-translated PRs of translation files. Supported file formats include, .ini, .po, .restext, .resx, .xliff .json.
Stars: ✭ 44 (+7.32%)
Mutual labels:  github-actions
github-action-ghr
GitHub Action to upload build artifacts to GitHub releases.
Stars: ✭ 47 (+14.63%)
Mutual labels:  github-actions
actions
Our Library of GitHub Actions
Stars: ✭ 49 (+19.51%)
Mutual labels:  github-actions
juejin-actions
掘金每天自动签到 github actions 。组织了每周一起学习200行左右的【源码共读】活动,感兴趣可以加我微信 ruochuan12 参与。
Stars: ✭ 47 (+14.63%)
Mutual labels:  github-actions
xunit-to-junit
This Extensible Stylesheet Language Transformations can transform a xUnit.net v2 XML test results file into a JUnit test results file.
Stars: ✭ 21 (-48.78%)
Mutual labels:  github-actions
vault-monkey
Extract secrets from your vault in a multi-machine cluster environment.
Stars: ✭ 12 (-70.73%)
Mutual labels:  secrets
QR-secret-sharing
🔒 Create QR codes to secret-share a message. Ideal for cryptocurrency wallet recovery keys and passwords.
Stars: ✭ 94 (+129.27%)
Mutual labels:  secrets
code-coverage-action
GitHub Action that generates code coverage reports
Stars: ✭ 28 (-31.71%)
Mutual labels:  github-actions
action-setup-kube-tools
Github Action that setup Kubernetes tools (kubectl, kustomize, helm, kubeconform, conftest, yq, rancher, tilt, skaffold) very fast and cache them on the runner. Please [✩Star] if you're using it!
Stars: ✭ 45 (+9.76%)
Mutual labels:  github-actions
actions-suggest-related-links
A GitHub Action to suggest related or similar issues, documents, and links. Based on the power of NLP and fastText.
Stars: ✭ 23 (-43.9%)
Mutual labels:  github-actions
sentry-releases-action
A GitHub action that creates releases for Sentry.io.
Stars: ✭ 38 (-7.32%)
Mutual labels:  github-actions
github-wiki-publish-action
GitHub Action that publishes the contents of a directory to your project's wiki
Stars: ✭ 75 (+82.93%)
Mutual labels:  github-actions
github-release
Github Action to create, update, or add files to Github Releases
Stars: ✭ 61 (+48.78%)
Mutual labels:  github-actions
post-medium-action
This action is for posting markdown based posts to medium
Stars: ✭ 45 (+9.76%)
Mutual labels:  github-actions
py-dependency-install
A GitHub Action that installs Python package dependencies from a user-defined requirements.txt file path with optional pip, setuptools, and wheel installs/updates
Stars: ✭ 23 (-43.9%)
Mutual labels:  github-actions
poc-github-actions
Various proofs of concept examples using Github Actions 🤖
Stars: ✭ 103 (+151.22%)
Mutual labels:  github-actions

githubsecrets

testing

GithubSecrets-Website

Manage your GitHub Actions secrets, with a simple CLI

GIF Demo

Usage-Demo

Installation

pip

Python v3.6.7 and above

Install with pip on your machine; the package is available at PyPi

$ pip install githubsecrets

From source

Python v3.6.7 and above

  1. Clone this repository
  2. Run the githubsecrets module (directory)
    python -m githubsecrets --help
    

Docker

Expand/Collapse

Mount a local directory to /app, the image is available at DockerHub

Linux and macOS

Mount your home directory, or any other directory to save the credentials file

$ docker run --rm -it -v "${HOME}/:/app/" unfor19/githubsecrets secret-list -p unfor19 -r githubsecrets
... # Output below
Output
[
  {
    "base_url": "https://api.github.com/repos/unfor19/githubsecrets",
    "body": {
      "secrets": [
        {
          "created_at": "2020-04-11T00:01:12Z",
          "name": "PIP_PASSWORD",
          "updated_at": "2020-04-11T00:17:39Z"
        },
        {
          "created_at": "2020-04-10T23:21:28Z",
          "name": "PIP_USERNAME",
          "updated_at": "2020-04-11T00:17:20Z"
        },
        {
          "created_at": "2020-04-27T20:44:09Z",
          "name": "testing",
          "updated_at": "2020-04-27T20:45:43Z"
        },
        {
          "created_at": "2020-04-27T20:22:37Z",
          "name": "testrepos",
          "updated_at": "2020-04-27T20:22:37Z"
        },
        {
          "created_at": "2020-04-14T14:14:44Z",
          "name": "TEST_GITHUB_TOKEN",
          "updated_at": "2020-04-14T14:14:44Z"
        }
      ],
      "total_count": 5
    },
    "repository": "githubsecrets",
    "status_code": 200
  }
]

Windows

Mount your Temp directory, or any other directory to save the credentials file. Make sure you use / and not \

$ docker run --rm -it -v c:/Temp:/app/ unfor19/githubsecrets secret-delete -p unfor19 -r githubsecrets -s testrepos
... # Output below
Output
[
  {
    "base_url": "https://api.github.com/repos/unfor19/githubsecrets",
    "repository": "githubsecrets",
    "secret_name": "testrepos",
    "status_code": 204
  }
]

Getting Started

Note: When using Docker, no need to add ghs; supply only a command and its arguments

  1. Initialize this application - Creates a credentials file at ~/.githubsecrets/credentials

    $ ghs init
  2. Generate a GitHub Personal-Access-Token with the following permissions:

    • repo (all)
    • admin:public_key > read:public_key
  3. Save the token in a safe place; we'll use it in the next step

  4. Create a profile, use the -p flag and supply a profile name

    $ ghs profile-apply -p willy_wonka
    ...
    SUCCESS: Applied the profile willy_wonka

    You'll be prompted to insert:

    • Github owner - which is your GitHub Organization or GitHub Account name (not email address)
    • Personal access token - that you've created in the previous steps
  5. 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"

    ghs secret-apply -p willy_wonka -r githubsecrets

    You'll be prompted to insert:

    • Secret name
    • Secret value
  6. Use it in your GitHub Actions Workflows

    • Snippet
      steps:
       - uses: actions/checkout@v2
       - name: Set up Python
         uses: actions/setup-python@v1
         with:
           python-version: "3.6"
       - name: Install dependencies
         run: |
           ...
       - name: Build and publish
         env:
           TWINE_USERNAME: ${{ secrets.PIP_USERNAME }}
           TWINE_PASSWORD: ${{ secrets.PIP_PASSWORD }}
           ...
         run: |
           ...
    • I'm using secrets in this repository, check out this repository's workflows

Status codes

  • 200 - success
  • 204 - success
  • 404 - secret or repository not found

Available commands

View all available commands with ghs --help

Usage: ghs [OPTIONS] COMMAND [ARGS]...

  All commands can run without providing options, and then you'll be
  prompted to insert values.

  Secrets' values and Personal-Access-Tokens are hidden when prompted

Options:
  -ci, --ci  Use this flag to avoid deletion confirmation prompts
  --help     Show this message and exit.

Commands:
  init            Create a credentials file to store your profiles
  profile-apply   Create or modify multiple profiles providing a string...
  profile-delete  Delete multiple profiles providing a string delimited by...
  profile-list    List all profile - truncates personal access tokens
  secret-apply    Apply to multiple repositories providing a string...
  secret-delete   Delete secrets from multiple repositories providing a...
  secret-get      Get secrets from multiple repositories providing a string...
  secret-list     List secrets of multiple repositories providing a string...

Troubleshooting

Ubuntu and Debian

This project uses the keyring package, in some versions of Ubuntu and Debian, you might need to install the following packages

$ sudo apt-get update && sudo apt-get install -y libdbus-glib-1-dev
$ pip install secretstorage dbus-python keyring

Contributing

Report issues/questions/feature requests on the Issues section.

Pull requests are welcome! Ideally, create a feature branch and issue for every single change you make. These are the steps:

  1. Fork this repo
  2. Create your feature branch from master (git checkout -b my-new-feature)
  3. Install from source
     $ git clone https://github.com/${GITHUB_OWNER}/githubsecrets.git && cd githubsecrets
     ...
     $ pip install --upgrade pip
     ...
     $ python -m venv ./ENV
     $ . ./ENV/bin/activate
     ...
     $ (ENV) pip install --editable .
     ...
     # Done! Now when you run 'ghs' it will get automatically updated when you modify the code
  4. Add the code of your new feature
  5. Test - generate a Personal Access Token for testing
    $ (ENV) bash scripts/test_functionality.sh -p PROFILE_NAME -o GITHUB_OWNER -t TEST_GITHUB_TOKEN -r GITHUB_REPOSITORY
    ... # All good? Move on to the next step
  6. Commit your remarkable changes (git commit -am 'Added new feature')
  7. Push to the branch (git push --set-up-stream origin my-new-feature)
  8. Create a new Pull Request and tell us about your changes

Authors

Created and maintained by Meir Gabay

Design by facebook.com/KerenOrDesign

License

This project is licensed under the MIT License - see the LICENSE file for details

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].