fix(ci): use cut instead of bash substring for short SHA (POSIX sh)
CI / Build Native (push) Failing after 9m5s
CI / Build Native (push) Failing after 9m5s
The act runner uses /bin/sh (dash on Debian/Ubuntu), not bash.
The syntax ${GITHUB_SHA::7} is bash-specific substring expansion
and throws 'Bad substitution' under dash.
Replace with POSIX-portable equivalent:
SHORT_SHA=$(echo "$GITHUB_SHA" | cut -c1-7)
Works in any sh-compatible shell (dash, bash, zsh, etc.).
This commit is contained in:
@@ -79,7 +79,7 @@ jobs:
|
||||
docker build -t shot-crafter-calculator:ci .
|
||||
echo "=== Login to Gitea Registry ==="
|
||||
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login gitea.danielarroyo.cl -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
|
||||
SHORT_SHA="${GITHUB_SHA::7}"
|
||||
SHORT_SHA=$(echo "$GITHUB_SHA" | cut -c1-7)
|
||||
echo "=== Tag ==="
|
||||
docker tag shot-crafter-calculator:ci gitea.danielarroyo.cl/proyectos/shot-crafter-calculator:latest
|
||||
docker tag shot-crafter-calculator:ci gitea.danielarroyo.cl/proyectos/shot-crafter-calculator:${SHORT_SHA}
|
||||
|
||||
Reference in New Issue
Block a user