Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions .github/actions/arcane-deploy/action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ AUTO_SYNC="${INPUT_AUTO_SYNC:-true}"
SYNC_INTERVAL="${INPUT_SYNC_INTERVAL:-5}"
TRIGGER_SYNC="${INPUT_TRIGGER_SYNC:-true}"
ENV_VARS="${INPUT_ENV_VARS:-}"
SYNC_NAME_PREFIX="${INPUT_SYNC_NAME_PREFIX:-${GITHUB_REPOSITORY##*/}}"

# [C1/C2] Mask secrets immediately, before any logging or API calls
[[ -n "${API_KEY}" ]] && echo "::add-mask::${API_KEY}"
Expand Down Expand Up @@ -167,25 +166,18 @@ discover_compose_files() {

# --- Sync Naming ---
# Derive a sync name from a compose file path.
# "stacks/myapp/compose.yml" -> "${prefix}-myapp"
# "compose.yml" (root) -> "${prefix}"
# "stacks/myapp/compose.yml" -> "myapp"
# "compose.yml" (root) -> "root"
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will never be possible. Everything will have a name.

What other complications are hiding behind the accordion here? Why isn't this as simple as possible?

sync_name_from_path() {
local path="$1"
local dir
dir=$(dirname "${path}")

local name
if [[ "${dir}" == "." ]]; then
name="${SYNC_NAME_PREFIX}"
echo "root"
else
name=$(basename "${dir}")
# Avoid "prefix-prefix" when the directory name matches the prefix
if [[ "${name}" != "${SYNC_NAME_PREFIX}" ]]; then
name="${SYNC_NAME_PREFIX}-${name}"
fi
basename "${dir}"
fi

echo "${name}"
}

# --- Repository Management ---
Expand Down
6 changes: 0 additions & 6 deletions .github/actions/arcane-deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ inputs:
required: false
default: 'true'

sync-name-prefix:
description: 'Prefix for sync names in Arcane. Defaults to the GitHub repository name.'
required: false
default: ''

# Workflow environment variables
env-vars:
description: 'Environment variables (KEY=VALUE per line) to export to the GitHub Actions runner via $GITHUB_ENV. These are available to subsequent workflow steps, NOT inside deployed containers. Values are automatically masked in logs.'
Expand Down Expand Up @@ -117,5 +112,4 @@ runs:
INPUT_AUTO_SYNC: ${{ inputs.auto-sync }}
INPUT_SYNC_INTERVAL: ${{ inputs.sync-interval }}
INPUT_TRIGGER_SYNC: ${{ inputs.trigger-sync }}
INPUT_SYNC_NAME_PREFIX: ${{ inputs.sync-name-prefix }}
INPUT_ENV_VARS: ${{ inputs.env-vars }}
Loading