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
fix: Add --repo option in order to correctly detect repository to add secret to (#3)
* fix: Add --repo option in order to correctly detect repository to add secret to
* docs: Automated README update
* docs: Update README with info about commits and repo secrets permissions
* docs: Update github_token description
* docs: Automated README update
Copy file name to clipboardExpand all lines: README.md
+19-4Lines changed: 19 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Rotates a HCP Terraform user token stored as a secret in a GitHub repository.
9
9
10
10
| name | description | required | default |
11
11
| --- | --- | --- | --- |
12
-
|`github_token`| <p>GitHub token used for writing the HCP Terraform user token to the repository secret store.</p> |`false`|`${{ github.token }}`|
12
+
|`github_token`| <p>GitHub token used for writing the HCP Terraform user token to the repository secret store. Requires the repository permission secrets:write.</p> |`true`|`""`|
13
13
|`github_secrets_name`| <p>Name of the secret in the repository secret store where the token will be written.</p> |`false`|`HCP_TERRAFORM_USER_TOKEN`|
14
14
|`hcp_terraform_user_token`| <p>HCP Terraform user token to be rotated. This token must already exist and be saved as a repository secret before running this action.</p> |`true`|`""`|
15
15
|`hcp_terraform_user_token_description`| <p>Description for the HCP Terraform user token. Must be the same for the original and new tokens.</p> |`false`|`github-token`|
@@ -26,10 +26,10 @@ This action is a `composite` action.
[Commit headers](https://github.com/angular/angular/blob/main/CONTRIBUTING.md#commit-header) are expected in order for version bumping to work correctly:
64
+
65
+
-**build**: Changes that affect the build system or external dependencies
66
+
-**ci**: Changes to CI configuration files and scripts
67
+
-**docs**: Documentation only changes
68
+
-**feat**: A new feature
69
+
-**fix**: A bug fix
70
+
-**perf**: A code change that improves performance
71
+
-**refactor**: A code change that neither fixes a bug nor adds a feature
72
+
-**test**: Adding missing tests or correcting existing tests
73
+
60
74
Resources
61
75
---------
62
76
63
77
-[Changing Passwords and Updating Tokens Outside of the Terraform Cloud and Terraform Enterprise UI](https://support.hashicorp.com/hc/en-us/articles/4402342106003-Changing-Passwords-and-Updating-Tokens-Outside-of-the-Terraform-Cloud-and-Terraform-Enterprise-UI)
78
+
-[Create or update a repository secret](https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret)
Copy file name to clipboardExpand all lines: action.yml
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,8 @@ author: Ben Dwyer (github.com/bendwyer)
5
5
6
6
inputs:
7
7
github_token:
8
-
description: GitHub token used for writing the HCP Terraform user token to the repository secret store.
9
-
required: false
10
-
default: ${{ github.token }}
8
+
description: "GitHub token used for writing the HCP Terraform user token to the repository secret store. Requires the repository permission secrets:write."
9
+
required: true
11
10
github_secrets_name:
12
11
description: Name of the secret in the repository secret store where the token will be written.
13
12
required: false
@@ -86,7 +85,7 @@ runs:
86
85
echo "Mask new token"
87
86
echo "::add-mask::$NEW_TOKEN"
88
87
echo "Write new token to repository secrets"
89
-
gh secret set $SECRETS_NAME --body "$NEW_TOKEN" --app actions
0 commit comments