File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,9 +16,6 @@ concurrency:
1616permissions :
1717 contents : read
1818
19- env :
20- image_tag : devcontainer:${{ github.head_ref || github.run_id }}
21-
2219jobs :
2320 build :
2421 name : Build
@@ -43,11 +40,23 @@ jobs:
4340 dockerfile : .devcontainer/ubuntu-24.04/Dockerfile
4441
4542 - name : Set up Docker Buildx
46- uses : docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
43+ uses : docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
44+
45+ - name : Prepare image tag
46+ shell : bash
47+ run : |
48+ RAW_TAG="${GITHUB_HEAD_REF:-$GITHUB_RUN_ID}"
49+ SAFE_TAG=$(echo "$RAW_TAG" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9_.-]/-/g')
50+ if ! [[ "$SAFE_TAG" =~ ^[a-z0-9_] ]]; then SAFE_TAG="x-$SAFE_TAG"; fi
51+ SAFE_TAG="${SAFE_TAG:0:128}"
52+ echo "image_tag=devcontainer:${SAFE_TAG}" >> "$GITHUB_ENV"
4753
4854 - name : Build Docker image
4955 run : |
50- docker buildx build .devcontainer/ubuntu-24.04/ --tag "${{ env.image_tag }}" --label "runnumber=${{ github.run_id }}" --load
56+ docker buildx build .devcontainer/ubuntu-24.04/ \
57+ --tag "${{ env.image_tag }}" \
58+ --label "runnumber=${{ github.run_id }}" \
59+ --load
5160
5261 - uses : addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # v3
5362 env :
You can’t perform that action at this time.
0 commit comments