官方的样板代码是通过以下方式注入npm令牌:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
我该如何访问和设置这个变量?在GUI中找不到它。
如何操作?
官方的样板代码是通过以下方式注入npm令牌:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
我该如何访问和设置这个变量?在GUI中找不到它。
如何操作?
Create or update an repository secret:
Creates or updates an organization secret with an encrypted value. Encrypt your secret using LibSodium.
You must authenticate using an access token with the
admin:repo
scope to use this endpoint.
GitHub Apps must have thesecrets
organization permission to use this endpoint.PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}
所以GUI不再是唯一的选择:您可以通过这个新API进行脚本编写和get/set Actions secret。Get a repository secret
Gets a single secret without revealing its encrypted value.
Anyone with write access to the repository can use this endpoint.
GitHub Apps must have the secrets permission to use this endpoint.GET /repos/:owner/:repo/actions/secrets/:name
这个页面很难找到,但在官方文档中存在:创建和使用密钥(加密变量)。
为了方便起见,下面是从文档中复制的内容:
密钥名称不能包含任何空格。为了确保GitHub在日志中隐藏您的密钥,请避免使用结构化数据作为密钥的值,例如JSON或编码的Git blob。
上面的链接还提供了关于使用密钥的更多信息。
pip
安装它,也可以使用 Docker
,请阅读 README.md 获取更多信息。