@@ -18,6 +18,21 @@ Or install it yourself as:
1818
1919 $ gem install rake_github
2020
21+ ### System dependencies
22+
23+ The ` secrets ` task group encrypts secrets client-side using ` rbnacl ` , which
24+ requires the native [ libsodium] ( https://libsodium.org ) library to be present on
25+ the host. Install it before running any ` secrets ` task:
26+
27+ # macOS
28+ $ brew install libsodium
29+
30+ # Debian/Ubuntu
31+ $ apt-get install libsodium23
32+
33+ libsodium is only required when using the ` secrets ` tasks; the other task groups
34+ have no additional system dependencies.
35+
2136## Usage
2237
2338### define_deploy_keys_tasks
5267| deploy_keys_destroy_task_name | symbol | N | Option to change the destroy task name | : obliterate | : destroy |
5368| deploy_keys_provision_task_name | symbol | N | Option to change the provision task name | : add | : provision |
5469| deploy_keys_ensure_task_name | symbol | N | Option to change the ensure task name | : destroy_and_provision | : ensure |
55- | secrets | array | N | Secrets to provision on the repository | { name: string, value: string } | [ ] |
70+ | secrets | array | N | Secrets to provision on the repository | { name: string, value: string, dependabot: bool } | [ ] |
5671| secrets_namespace | symbol | N | Namespace to contain secrets tasks | : repository_secrets | : secrets |
5772| secrets_destroy_task_name | symbol | N | Option to change the secrets destroy task name | : obliterate | : destroy |
5873| secrets_provision_task_name | symbol | N | Option to change the secrets provision task name | : add | : provision |
@@ -103,9 +118,13 @@ the `%s` placeholder, e.g. `pull_requests:merge[new_feature,"%s [skip ci]"]`.
103118### define_secrets_tasks
104119
105120Sets up rake tasks for managing repository secrets. Each secret is written to
106- both the Actions and Dependabot secret stores, so that Dependabot-triggered
107- workflow runs can read them. Secrets are encrypted client-side before being
108- sent to GitHub.
121+ the Actions secret store by default. A secret can additionally be written to the
122+ Dependabot secret store by setting ` dependabot: true ` , so that
123+ Dependabot-triggered workflow runs can read the secrets they need. Secrets are
124+ encrypted client-side before being sent to GitHub.
125+
126+ These tasks require the native libsodium library to be installed on the host —
127+ see [ System dependencies] ( #system-dependencies ) above.
109128
110129``` ruby
111130require ' rake_github'
@@ -119,6 +138,11 @@ RakeGithub.define_secrets_tasks(
119138 {
120139 name: ' SOME_SECRET' ,
121140 value: ' some-plaintext-value'
141+ },
142+ {
143+ name: ' SHARED_SECRET' ,
144+ value: ' another-plaintext-value' ,
145+ dependabot: true # also write to the Dependabot store
122146 }
123147 ]
124148end
128152| ----------------------| --------| ----------| ------------------------------------------------------------| ---------------------------------------------| ------------|
129153| repository | string | Y | Repository to perform tasks upon | 'organisation/repository_name' | N/A |
130154| access_token | string | Y | Github token for authorisation | 'ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | N/A |
131- | secrets | array | N | Secrets to provision on the repository | { name: string, value: string } | [ ] |
155+ | secrets | array | N | Secrets to provision on the repository | { name: string, value: string, dependabot: bool } | [ ] |
132156| destroy_task_name | symbol | N | Option to change the destroy task name | : obliterate | : destroy |
133157| provision_task_name | symbol | N | Option to change the provision task name | : add | : provision |
134158| ensure_task_name | symbol | N | Option to change the ensure task name | : destroy_and_provision | : ensure |
@@ -146,8 +170,9 @@ rake secrets:provision
146170
147171#### secrets: provision
148172
149- Provisions the specified secrets to the repository, writing each one to both
150- the Actions and Dependabot secret stores.
173+ Provisions the specified secrets to the repository, writing each one to the
174+ Actions secret store and, for secrets marked ` dependabot: true ` , also to the
175+ Dependabot secret store.
151176
152177#### secrets: destroy
153178
@@ -220,7 +245,10 @@ and user reviewers to their numeric ids.
220245
221246#### environments: destroy
222247
223- Destroys the specified environments from the repository.
248+ Destroys the specified environments from the repository. This is irreversible
249+ and also discards each environment's protection rules, environment secrets and
250+ deployment history. ` environments:ensure ` therefore fully recreates each
251+ environment rather than patching it in place.
224252
225253#### environments: ensure
226254
0 commit comments