You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tools/ghsecrets/README.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,43 +27,43 @@ By default, `ghsecrets set` assumes you want to store secrets in AWS Secrets Man
27
27
28
28
#### a) Set secrets in AWS (default)
29
29
30
-
This will read from `~/.testsecrets` (by default) and create/update a secret in AWS Secrets Manager:
31
-
32
30
> **⚠️ Note:** Ensure you authenticate with AWS before using the tool:
33
31
>
34
32
> ```sh
35
-
> aws sso login --profile <my-profile>
33
+
> aws sso login --profile <your-aws-profile>
36
34
>```
37
-
> By default, use the `SDLC` profile
35
+
> By default, use the SDLC profile
36
+
37
+
This will read from `~/.testsecrets` (by default) and create/update a secret in AWS Secrets Manager:
38
38
39
39
```sh
40
-
ghsecrets set
40
+
ghsecrets set --profile <your-aws-profile>
41
41
```
42
42
43
43
If you’d like to specify a different file:
44
44
45
45
```sh
46
-
ghsecrets set --file /path/to/mysecrets.env
46
+
ghsecrets set --file /path/to/mysecrets.env --profile <your-aws-profile>
47
47
```
48
48
49
49
If you’d like to specify a custom secret name:
50
50
51
51
```sh
52
-
ghsecrets set --secret-id my-custom-secret
52
+
ghsecrets set --secret-id my-custom-secret --profile <your-aws-profile>
53
53
```
54
54
55
55
Note: For AWS backend, the tool automatically adds the `testsecrets/` prefix if it is missing. This ensures consistency and allows GitHub Actions to access all secrets with this designated prefix.
56
56
57
57
If you’d like to share this secret with additional AWS IAM principals (e.g., a collaborator’s account):
58
58
59
59
```sh
60
-
ghsecrets set --shared-with arn:aws:iam::123456789012:role/SomeRole
60
+
ghsecrets set --shared-with arn:aws:iam::123456789012:role/SomeRole --profile <your-aws-profile>
61
61
```
62
62
63
63
You can specify multiple ARNs using commas:
64
64
65
65
```sh
66
-
ghsecrets set --shared-with arn:aws:iam::123456789012:role/SomeRole,arn:aws:iam::345678901234:root
66
+
ghsecrets set --shared-with arn:aws:iam::123456789012:role/SomeRole,arn:aws:iam::345678901234:root --profile <your-aws-profile>
67
67
```
68
68
69
69
#### b) Set secrets in GitHub
@@ -82,13 +82,13 @@ This will:
82
82
If you want to retrieve an existing secret from AWS Secrets Manager, use:
83
83
84
84
```sh
85
-
ghsecrets get --secret-id testsecrets/MySecretName
85
+
ghsecrets get --secret-id testsecrets/MySecretName --profile <your-aws-profile>
86
86
```
87
87
88
88
By default, it prints out the Base64-encoded string. To decode it automatically:
89
89
90
90
```sh
91
-
ghsecrets get --secret-id testsecrets/MySecretName --decode
91
+
ghsecrets get --secret-id testsecrets/MySecretName --decode --profile <your-aws-profile>
0 commit comments