Skip to content

Commit

Permalink
fix: rename CODER_ACCESS_URL to CODER_URL
Browse files Browse the repository at this point in the history
matifali committed Jun 7, 2023
1 parent 55e892b commit a16ab1c
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ Update coder templates automatically

| Name | Description | Default |
| ------------------------- | ------------------------------------------------------------------------ | ----------------------------- |
| `CODER_ACCESS_URL` | **Required** The url of coder deployment (e.g. <https://dev.coder.com>). | - |
| `CODER_URL` | **Required** The url of coder deployment (e.g. <https://dev.coder.com>). | - |
| `CODER_SESSION_TOKEN` | **Required** The session token of coder. | `secrets.CODER_SESSION_TOKEN` |
| `CODER_TEMPLATE_NAME` | **Required** The name of template. | - |
| `CODER_TEMPLATE_DIR` | The directory of template. | `CODER_TEMPLATE_NAME` |
@@ -45,7 +45,7 @@ Update coder templates automatically
with:
CODER_TEMPLATE_NAME: "my-template"
CODER_TEMPLATE_DIR: "my-template"
CODER_ACCESS_URL: "https://coder.example.com"
CODER_URL: "https://coder.example.com"
CODER_TEMPLATE_VERSION: "${{ steps.latest_commit.outputs.hash }}"
CODER_SESSION_TOKEN: ${{ secrets.CODER_SESSION_TOKEN }}
```
@@ -72,7 +72,7 @@ Update coder templates automatically
with:
CODER_TEMPLATE_NAME: "my-template"
CODER_TEMPLATE_DIR: "my-template"
CODER_ACCESS_URL: "https://coder.example.com"
CODER_URL: "https://coder.example.com"
CODER_TEMPLATE_ACTIVATE: "false"
CODER_SESSION_TOKEN: ${{ secrets.CODER_SESSION_TOKEN }}
```
4 changes: 2 additions & 2 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ inputs:
CODER_TEMPLATE_NAME:
description: "Template name"
required: true
CODER_ACCESS_URL:
CODER_URL:
description: "Coder access URL (e.g. https://coder.example.com)"
required: true
CODER_SESSION_TOKEN:
@@ -34,7 +34,7 @@ runs:
image: "Dockerfile"
env:
CODER_SESSION_TOKEN: ${{ inputs.CODER_SESSION_TOKEN }}
CODER_ACCESS_URL: ${{ inputs.CODER_ACCESS_URL }}
CODER_URL: ${{ inputs.CODER_URL }}
CODER_TEMPLATE_NAME: ${{ inputs.CODER_TEMPLATE_NAME }}
CODER_TEMPLATE_DIR: ${{ inputs.CODER_TEMPLATE_DIR }}
CODER_TEMPLATE_VERSION: ${{ inputs.CODER_TEMPLATE_VERSION }}
10 changes: 5 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -5,17 +5,17 @@ set -euo pipefail
: "${CODER_SESSION_TOKEN:?Variable not set or empty}"
echo "CODER_SESSION_TOKEN is set."

: "${CODER_ACCESS_URL:?Variable not set or empty}"
echo "CODER_ACCESS_URL: ${CODER_ACCESS_URL}"
: "${CODER_URL:?Variable not set or empty}"
echo "CODER_URL: ${CODER_URL}"

echo "Pushing ${CODER_TEMPLATE_NAME} to ${CODER_ACCESS_URL}..."
echo "Pushing ${CODER_TEMPLATE_NAME} to ${CODER_URL}..."

# Set default values if variables are empty
CODER_TEMPLATE_DIR=${CODER_TEMPLATE_DIR:-$CODER_TEMPLATE_NAME}
echo "CODER_TEMPLATE_DIR is set to ${CODER_TEMPLATE_DIR}"

# Construct push command
push_command="coder templates push ${CODER_TEMPLATE_NAME} --directory ./${CODER_TEMPLATE_DIR}" --url ${CODER_ACCESS_URL} --token ${CODER_SESSION_TOKEN}
push_command="coder templates push ${CODER_TEMPLATE_NAME} --directory ./${CODER_TEMPLATE_DIR}" --url ${CODER_URL} --token ${CODER_SESSION_TOKEN}

# Add version to the push command if specified
if [ -n "${CODER_TEMPLATE_VERSION}" ]; then
@@ -33,4 +33,4 @@ push_command+=" --yes"
# Execute the push command
${push_command}

echo "Template ${CODER_TEMPLATE_NAME} pushed to ${CODER_ACCESS_URL}."
echo "Template ${CODER_TEMPLATE_NAME} pushed to ${CODER_URL}."

0 comments on commit a16ab1c

Please sign in to comment.