Skip to content

Commit 6445a68

Browse files
committed
Apply requested changes
1 parent 0450473 commit 6445a68

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
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:
@@ -55,23 +55,14 @@ jobs:
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' || toLower(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 }}
6262
# Github does not allow evaluating a secret in an if condition, so we need to set them as environment variables
6363
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
6464
DOCKERHUB_LOGIN: ${{ secrets.DOCKERHUB_LOGIN }}
6565
steps:
66-
# Image repo names have to be lowercase.
67-
- name: Set image repository name
68-
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"
7566
- uses: actions/checkout@v6
7667
- uses: actions/setup-python@v6
7768
- run: pip install -r tests/ci-requirements.txt

0 commit comments

Comments
 (0)