2525 - uses : pre-commit/action@v1.0.1
2626
2727 build-test-push :
28- if : github.ref == 'refs/heads/master' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
28+ if : github.ref == github.event.repository.default_branch || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
2929 runs-on : ubuntu-latest
3030 needs : pre-commit
3131 permissions :
5555 LOCAL_REGISTRY : localhost:5000
5656 # Indicates what's the equivalent to tecnativa/postgres-autoconf:latest image
5757 LATEST_RELEASE : " 18-alpine"
58- DOCKER_REPO : " " # Set in the next step
58+ DOCKER_REPO : ${{ github.repository == 'Tecnativa/docker-postgres-autoconf' && 'tecnativa/postgres-autoconf' || github.repository }}
5959 BASE_TAG : ${{ matrix.pg_version }}-alpine
6060 DOCKER_TAG : ${{ github.event_name == 'pull_request' && format('{0}-test-pr{1}', matrix.pg_version, github.event.number) || format('{0}-alpine', matrix.pg_version) }}
6161 GIT_SHA1 : ${{ github.sha }}
@@ -64,14 +64,10 @@ jobs:
6464 DOCKERHUB_LOGIN : ${{ secrets.DOCKERHUB_LOGIN }}
6565 steps :
6666 # Image repo names have to be lowercase.
67- - name : Set image repository name
67+ - name : Lowercase image repository name
6868 run : |
69- if [ "$GITHUB_REPOSITORY" = "Tecnativa/docker-postgres-autoconf" ]; then
70- DOCKER_REPO=tecnativa/postgres-autoconf
71- else
72- DOCKER_REPO=${GITHUB_REPOSITORY,,}
73- fi
74- echo "DOCKER_REPO=$DOCKER_REPO" >> "$GITHUB_ENV"
69+ DOCKER_REPO=${DOCKER_REPO,,}
70+ echo "DOCKER_REPO=$DOCKER_REPO" >> "$GITHUB_ENV"
7571 - uses : actions/checkout@v6
7672 - uses : actions/setup-python@v6
7773 - run : pip install -r tests/ci-requirements.txt
0 commit comments