|
25 | 25 | - uses: pre-commit/action@v1.0.1 |
26 | 26 |
|
27 | 27 | 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) |
29 | 29 | runs-on: ubuntu-latest |
30 | 30 | needs: pre-commit |
31 | 31 | permissions: |
@@ -55,23 +55,14 @@ jobs: |
55 | 55 | LOCAL_REGISTRY: localhost:5000 |
56 | 56 | # Indicates what's the equivalent to tecnativa/postgres-autoconf:latest image |
57 | 57 | 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) }} |
59 | 59 | BASE_TAG: ${{ matrix.pg_version }}-alpine |
60 | 60 | DOCKER_TAG: ${{ github.event_name == 'pull_request' && format('{0}-test-pr{1}', matrix.pg_version, github.event.number) || format('{0}-alpine', matrix.pg_version) }} |
61 | 61 | GIT_SHA1: ${{ github.sha }} |
62 | 62 | # Github does not allow evaluating a secret in an if condition, so we need to set them as environment variables |
63 | 63 | DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} |
64 | 64 | DOCKERHUB_LOGIN: ${{ secrets.DOCKERHUB_LOGIN }} |
65 | 65 | 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" |
75 | 66 | - uses: actions/checkout@v6 |
76 | 67 | - uses: actions/setup-python@v6 |
77 | 68 | - run: pip install -r tests/ci-requirements.txt |
|
0 commit comments