Compare commits
2 Commits
21a8023bf1
...
9657bd7a36
| Author | SHA1 | Date | |
|---|---|---|---|
| 9657bd7a36 | |||
| 574e2eb9a5 |
20
.github/workflows/docker-release.yml
vendored
20
.github/workflows/docker-release.yml
vendored
@@ -51,10 +51,28 @@ jobs:
|
|||||||
if [ -z "$NS" ]; then
|
if [ -z "$NS" ]; then
|
||||||
NS="${{ secrets.DOCKERHUB_USERNAME }}"
|
NS="${{ secrets.DOCKERHUB_USERNAME }}"
|
||||||
fi
|
fi
|
||||||
if [ -z "$NS" ]; then
|
|
||||||
|
# Normalize accidental input like spaces or uppercase.
|
||||||
|
NS="$(echo "$NS" | tr '[:upper:]' '[:lower:]' | xargs)"
|
||||||
|
|
||||||
|
# Reject clearly invalid placeholders/config mistakes early.
|
||||||
|
if [ -z "$NS" ] || [ "$NS" = "-" ]; then
|
||||||
echo "Missing Docker Hub namespace. Set repo var DOCKERHUB_NAMESPACE or secret DOCKERHUB_USERNAME."
|
echo "Missing Docker Hub namespace. Set repo var DOCKERHUB_NAMESPACE or secret DOCKERHUB_USERNAME."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Namespace must be a single Docker Hub account/org name, not a path/url.
|
||||||
|
if [[ "$NS" == *"/"* ]] || [[ "$NS" == *":"* ]]; then
|
||||||
|
echo "Invalid Docker Hub namespace '$NS'. Use only the account/org name (e.g. 'nesterovicit')."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! [[ "$NS" =~ ^[a-z0-9]+([._-][a-z0-9]+)*$ ]]; then
|
||||||
|
echo "Invalid Docker Hub namespace '$NS'. Allowed: lowercase letters, digits, ., _, -"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Using Docker Hub namespace: $NS"
|
||||||
echo "value=$NS" >> "$GITHUB_OUTPUT"
|
echo "value=$NS" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
|
|||||||
Reference in New Issue
Block a user