partially improved readme, added coder email and username variables

pull/47/head
Stephen Kirby 2 years ago
parent 5952e5a086
commit ac912626ad

@ -4,9 +4,16 @@ description: Stores Git configuration from Coder credentials
icon: ../.icons/git.svg
maintainer_github: coder
verified: true
tags: [helper]
tags: [helper, git]
---
# git-config
Runs a script that checks for stored Git credentials, populating them with coder credentials when missing.
Runs a script that checks for stored Git credentials, populating them with user's Coder credentials when missing.
## Examples
```hcl
```

@ -14,9 +14,23 @@ variable "agent_id" {
description = "The ID of a Coder agent."
}
# TODO: Check if agent ID can provide workspace username and email
variable "username" {
type = string
description = "The username of the Coder workspace owner."
}
variable "user_email" {
type = string
description = "The email of the Coder workspace owner."
}
resource "coder_script" "personalize" {
agent_id = var.agent_id
script = templatefile("${path.module}/run.sh", {}) # TODO: maybe remove templatefile
script = templatefile("${path.module}/run.sh", {
CODER_USERNAME = var.username,
CODER_EMAIL = var.user_email
})
display_name = "Git Config"
icon = "/emojis/1f58c.png" # TODO: test if the local git icon works
run_on_start = true

@ -3,8 +3,8 @@
BOLD='\033[0;1m'
CODE='\033[36;40;1m'
RESET='\033[0m'
# CODER_EMAIL="${CODER_EMAIL}"
# CODER_USERNAME="${CODER_USERNAME}"
CODER_EMAIL="${CODER_EMAIL}"
CODER_USERNAME="${CODER_USERNAME}"
echo "Running git-config script!\n\n"

Loading…
Cancel
Save