Skip to content

Commit db1fcf3

Browse files
authored
docker build command in tests now checks reason for docker build failure. If it is a permission issue with the cache, it will continue the rest of the workflow (#576)
1 parent 36228ce commit db1fcf3

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/actions/gmt-pytest/action.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,21 @@ runs:
6060
password: ${{ inputs.github-token }}
6161

6262
- name: Build docker-compose
63+
id: build-docker-compose
6364
shell: bash
6465
working-directory: ${{ inputs.gmt-directory }}/docker
65-
run: docker buildx bake --file test-compose.yml --file docker-compose-cache.json
66+
run: |
67+
{ DOCKER_OUTPUT=$(docker buildx bake --file test-compose.yml --file docker-compose-cache.json 2>&1); DOCKER_EXIT_CODE=$?; } || true
68+
if [ "$DOCKER_EXIT_CODE" -ne 0 ]; then
69+
echo "Docker build failed with exit code $DOCKER_EXIT_CODE"
70+
echo "buildx output:"
71+
echo $DOCKER_OUTPUT
72+
if echo "$DOCKER_OUTPUT" | grep -q "403 Forbidden"; then
73+
echo "Docker build failed due to permissions issue. Continuing..."
74+
else
75+
exit 1
76+
fi
77+
fi
6678
6779
- name: Start Test container
6880
shell: bash

0 commit comments

Comments
 (0)