用于管理GitHub机密的简单CLI,用于GitHub操作
githubsecrets的Python项目详细描述
吉图布秘密
使用简单的CLI管理您的GitHub Actions机密
GIF演示
摘要>详细信息>安装
pip
Python v3.6.7及更高版本
在您的计算机上使用pip安装;该软件包在PyPi上提供
$ pip install githubsecrets
来源
Python v3.6.7及更高版本
- 克隆此存储库
- 运行
githubsecrets
模块(目录)
^{pr2}$
在
Docker
展开/折叠
摘要>将本地目录装载到root
,映像可在DockerHub获得
Linux和macOS
装入主目录或任何其他目录以保存凭据文件
$ docker run --rm -it -v "${HOME}/:/root" unfor19/githubsecrets secret-list -p unfor19 -r githubsecrets
... # Output below
输出
摘要>[{"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}]
详细信息>窗口
挂载临时目录或任何其他目录以保存凭证文件。确保使用/
而不是{}
$ docker run --rm -it -v c:/Temp:/root unfor19/githubsecrets secret-delete -p unfor19 -r githubsecrets -s testrepos
... # Output below
输出
摘要>[{"base_url":"https://api.github.com/repos/unfor19/githubsecrets","repository":"githubsecrets","secret_name":"testrepos","status_code":204}]
详细信息>详细信息>入门
Note:使用Docker时,不需要添加ghs
;只需提供命令及其参数
- 在
初始化此应用程序-在~/.githubsecrets/credentials
处创建凭据文件
$ ghs init
在 - 在
Generate a GitHub Personal-Access-Token具有以下权限:
- 回购(全部)
- 在管理员:公钥>;读:公钥在
在 - 在
将令牌保存在安全的地方;我们将在下一步中使用它
在 - 在
创建一个概要文件,使用-p
标志并提供一个概要文件名
$ ghs profile-apply -p willy_wonka
...
SUCCESS: Applied the profile willy_wonka
系统将提示您插入:
- Github所有者-是您的Github组织或Github帐户名(不是电子邮件地址)
- 个人访问令牌-您在前面的步骤中创建的
在 - 在
创建一个GitHub机密,使用-r
标志并提供存储库的名称。您可以同时对多个存储库应用相同的机密,例如:-r "githubsecrets, aws-build-badges"
ghs secret-apply -p willy_wonka -r githubsecrets
系统将提示您插入:
- 秘密名称
- 秘密价值
在 - 在
在你的GitHub Actions Workflows中使用它
- 代码段
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: |
...
在 - 我正在使用此存储库中的机密,请查看this repository's workflows
在
状态代码
- 200-成功
- 204-成功
- 404-未找到机密或存储库
可用命令
使用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...
故障排除
Ubuntu和Debian
{a8可能需要在这个项目中安装一个^和}软件包
$ sudo apt-get update && sudo apt-get install -y libdbus-glib-1-dev
$ pip install secretstorage dbus-python keyring
贡献
在Issues部分报告问题/问题/功能请求。在
欢迎拉请求!理想情况下,为您所做的每一个更改创建一个功能分支和问题。步骤如下:
- 进行回购
- 从master(
git checkout -b my-new-feature
)创建特性分支 - 从源安装
$ 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
在 - 添加新功能的代码
- 测试-生成用于测试的个人访问令牌
$ (ENV) bash test_functionality.sh -p PROFILE_NAME -o GITHUB_OWNER -t TEST_GITHUB_TOKEN -r GITHUB_REPOSITORY
... # All good? Move on to the next step
在 - 做出显著的改变(
git commit -am 'Added new feature'
) - 推到分支(
git push --set-up-stream origin my-new-feature
) - 创建新的请求请求并告诉我们您的更改
作者
由Meir Gabay创建和维护
许可证
这个项目是在麻省理工学院许可下授权的-有关详细信息,请参阅LICENSE文件
标签:
- 项目
推荐PyPI第三方库
githubsecrets
模块(目录)
^{pr2}$
在展开/折叠
摘要>将本地目录装载到root
,映像可在DockerHub获得
Linux和macOS
装入主目录或任何其他目录以保存凭据文件
$ docker run --rm -it -v "${HOME}/:/root" unfor19/githubsecrets secret-list -p unfor19 -r githubsecrets
... # Output below
输出
摘要>[{"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}]
详细信息>窗口
挂载临时目录或任何其他目录以保存凭证文件。确保使用/
而不是{}
$ docker run --rm -it -v c:/Temp:/root unfor19/githubsecrets secret-delete -p unfor19 -r githubsecrets -s testrepos
... # Output below
输出
摘要>[{"base_url":"https://api.github.com/repos/unfor19/githubsecrets","repository":"githubsecrets","secret_name":"testrepos","status_code":204}]
详细信息>详细信息>入门
Note:使用Docker时,不需要添加ghs
;只需提供命令及其参数
- 在
初始化此应用程序-在~/.githubsecrets/credentials
处创建凭据文件
$ ghs init
在 - 在
Generate a GitHub Personal-Access-Token具有以下权限:
- 回购(全部)
- 在管理员:公钥>;读:公钥在
在 - 在
将令牌保存在安全的地方;我们将在下一步中使用它
在 - 在
创建一个概要文件,使用-p
标志并提供一个概要文件名
$ ghs profile-apply -p willy_wonka
...
SUCCESS: Applied the profile willy_wonka
系统将提示您插入:
- Github所有者-是您的Github组织或Github帐户名(不是电子邮件地址)
- 个人访问令牌-您在前面的步骤中创建的
在 - 在
创建一个GitHub机密,使用-r
标志并提供存储库的名称。您可以同时对多个存储库应用相同的机密,例如:-r "githubsecrets, aws-build-badges"
ghs secret-apply -p willy_wonka -r githubsecrets
系统将提示您插入:
- 秘密名称
- 秘密价值
在 - 在
在你的GitHub Actions Workflows中使用它
- 代码段
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: |
...
在 - 我正在使用此存储库中的机密,请查看this repository's workflows
在
状态代码
- 200-成功
- 204-成功
- 404-未找到机密或存储库
可用命令
使用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...
故障排除
Ubuntu和Debian
{a8可能需要在这个项目中安装一个^和}软件包
$ sudo apt-get update && sudo apt-get install -y libdbus-glib-1-dev
$ pip install secretstorage dbus-python keyring
贡献
在Issues部分报告问题/问题/功能请求。在
欢迎拉请求!理想情况下,为您所做的每一个更改创建一个功能分支和问题。步骤如下:
- 进行回购
- 从master(
git checkout -b my-new-feature
)创建特性分支 - 从源安装
$ 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
在 - 添加新功能的代码
- 测试-生成用于测试的个人访问令牌
$ (ENV) bash test_functionality.sh -p PROFILE_NAME -o GITHUB_OWNER -t TEST_GITHUB_TOKEN -r GITHUB_REPOSITORY
... # All good? Move on to the next step
在 - 做出显著的改变(
git commit -am 'Added new feature'
) - 推到分支(
git push --set-up-stream origin my-new-feature
) - 创建新的请求请求并告诉我们您的更改
作者
由Meir Gabay创建和维护
许可证
这个项目是在麻省理工学院许可下授权的-有关详细信息,请参阅LICENSE文件
标签:
- 项目
推荐PyPI第三方库
root
,映像可在DockerHub获得输出
摘要>[{"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}]
详细信息>窗口
挂载临时目录或任何其他目录以保存凭证文件。确保使用/
而不是{}
$ docker run --rm -it -v c:/Temp:/root unfor19/githubsecrets secret-delete -p unfor19 -r githubsecrets -s testrepos
... # Output below
输出
摘要>[{"base_url":"https://api.github.com/repos/unfor19/githubsecrets","repository":"githubsecrets","secret_name":"testrepos","status_code":204}]
详细信息>详细信息>入门
Note:使用Docker时,不需要添加ghs
;只需提供命令及其参数
- 在
初始化此应用程序-在~/.githubsecrets/credentials
处创建凭据文件
$ ghs init
在 - 在
Generate a GitHub Personal-Access-Token具有以下权限:
- 回购(全部)
- 在管理员:公钥>;读:公钥在
在 - 在
将令牌保存在安全的地方;我们将在下一步中使用它
在 - 在
创建一个概要文件,使用-p
标志并提供一个概要文件名
$ ghs profile-apply -p willy_wonka
...
SUCCESS: Applied the profile willy_wonka
系统将提示您插入:
- Github所有者-是您的Github组织或Github帐户名(不是电子邮件地址)
- 个人访问令牌-您在前面的步骤中创建的
在 - 在
创建一个GitHub机密,使用-r
标志并提供存储库的名称。您可以同时对多个存储库应用相同的机密,例如:-r "githubsecrets, aws-build-badges"
ghs secret-apply -p willy_wonka -r githubsecrets
系统将提示您插入:
- 秘密名称
- 秘密价值
在 - 在
在你的GitHub Actions Workflows中使用它
- 代码段
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: |
...
在 - 我正在使用此存储库中的机密,请查看this repository's workflows
在
状态代码
- 200-成功
- 204-成功
- 404-未找到机密或存储库
可用命令
使用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...
故障排除
Ubuntu和Debian
{a8可能需要在这个项目中安装一个^和}软件包
$ sudo apt-get update && sudo apt-get install -y libdbus-glib-1-dev
$ pip install secretstorage dbus-python keyring
贡献
在Issues部分报告问题/问题/功能请求。在
欢迎拉请求!理想情况下,为您所做的每一个更改创建一个功能分支和问题。步骤如下:
- 进行回购
- 从master(
git checkout -b my-new-feature
)创建特性分支 - 从源安装
$ 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
在 - 添加新功能的代码
- 测试-生成用于测试的个人访问令牌
$ (ENV) bash test_functionality.sh -p PROFILE_NAME -o GITHUB_OWNER -t TEST_GITHUB_TOKEN -r GITHUB_REPOSITORY
... # All good? Move on to the next step
在 - 做出显著的改变(
git commit -am 'Added new feature'
) - 推到分支(
git push --set-up-stream origin my-new-feature
) - 创建新的请求请求并告诉我们您的更改
作者
由Meir Gabay创建和维护
许可证
这个项目是在麻省理工学院许可下授权的-有关详细信息,请参阅LICENSE文件
标签:
- 项目
推荐PyPI第三方库
/
而不是{$ docker run --rm -it -v c:/Temp:/root unfor19/githubsecrets secret-delete -p unfor19 -r githubsecrets -s testrepos
... # Output below
输出
摘要>[{"base_url":"https://api.github.com/repos/unfor19/githubsecrets","repository":"githubsecrets","secret_name":"testrepos","status_code":204}]
详细信息>详细信息>入门
Note:使用Docker时,不需要添加ghs
;只需提供命令及其参数
- 在
初始化此应用程序-在~/.githubsecrets/credentials
处创建凭据文件
$ ghs init
在 - 在
Generate a GitHub Personal-Access-Token具有以下权限:
- 回购(全部)
- 在管理员:公钥>;读:公钥在
在 - 在
将令牌保存在安全的地方;我们将在下一步中使用它
在 - 在
创建一个概要文件,使用-p
标志并提供一个概要文件名
$ ghs profile-apply -p willy_wonka
...
SUCCESS: Applied the profile willy_wonka
系统将提示您插入:
- Github所有者-是您的Github组织或Github帐户名(不是电子邮件地址)
- 个人访问令牌-您在前面的步骤中创建的
在 - 在
创建一个GitHub机密,使用-r
标志并提供存储库的名称。您可以同时对多个存储库应用相同的机密,例如:-r "githubsecrets, aws-build-badges"
ghs secret-apply -p willy_wonka -r githubsecrets
系统将提示您插入:
- 秘密名称
- 秘密价值
在 - 在
在你的GitHub Actions Workflows中使用它
- 代码段
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: |
...
在 - 我正在使用此存储库中的机密,请查看this repository's workflows
在
状态代码
- 200-成功
- 204-成功
- 404-未找到机密或存储库
可用命令
使用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...
故障排除
Ubuntu和Debian
{a8可能需要在这个项目中安装一个^和}软件包
$ sudo apt-get update && sudo apt-get install -y libdbus-glib-1-dev
$ pip install secretstorage dbus-python keyring
贡献
在Issues部分报告问题/问题/功能请求。在
欢迎拉请求!理想情况下,为您所做的每一个更改创建一个功能分支和问题。步骤如下:
- 进行回购
- 从master(
git checkout -b my-new-feature
)创建特性分支 - 从源安装
$ 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
在 - 添加新功能的代码
- 测试-生成用于测试的个人访问令牌
$ (ENV) bash test_functionality.sh -p PROFILE_NAME -o GITHUB_OWNER -t TEST_GITHUB_TOKEN -r GITHUB_REPOSITORY
... # All good? Move on to the next step
在 - 做出显著的改变(
git commit -am 'Added new feature'
) - 推到分支(
git push --set-up-stream origin my-new-feature
) - 创建新的请求请求并告诉我们您的更改
作者
由Meir Gabay创建和维护
许可证
这个项目是在麻省理工学院许可下授权的-有关详细信息,请参阅LICENSE文件
标签:
- 项目
推荐PyPI第三方库
ghs
;只需提供命令及其参数初始化此应用程序-在~/.githubsecrets/credentials
处创建凭据文件
$ ghs init在
Generate a GitHub Personal-Access-Token具有以下权限:
- 回购(全部)
- 在管理员:公钥>;读:公钥在
将令牌保存在安全的地方;我们将在下一步中使用它
在创建一个概要文件,使用-p
标志并提供一个概要文件名
$ ghs profile-apply -p willy_wonka ... SUCCESS: Applied the profile willy_wonka
系统将提示您插入:
- Github所有者-是您的Github组织或Github帐户名(不是电子邮件地址)
- 个人访问令牌-您在前面的步骤中创建的
创建一个GitHub机密,使用-r
标志并提供存储库的名称。您可以同时对多个存储库应用相同的机密,例如:-r "githubsecrets, aws-build-badges"
ghs secret-apply -p willy_wonka -r githubsecrets
系统将提示您插入:
- 秘密名称
- 秘密价值
在你的GitHub Actions Workflows中使用它
- 代码段
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: | ...
在 - 我正在使用此存储库中的机密,请查看this repository's workflows
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...
$ sudo apt-get update && sudo apt-get install -y libdbus-glib-1-dev
$ pip install secretstorage dbus-python keyring
git checkout -b my-new-feature
)创建特性分支$ 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在
$ (ENV) bash test_functionality.sh -p PROFILE_NAME -o GITHUB_OWNER -t TEST_GITHUB_TOKEN -r GITHUB_REPOSITORY ... # All good? Move on to the next step在
git commit -am 'Added new feature'
)git push --set-up-stream origin my-new-feature
)标签: