|
54 | 54 | timeout-minutes: 30 |
55 | 55 | needs: check-changes |
56 | 56 | if: needs.check-changes.outputs.source-changed == 'true' |
| 57 | + outputs: |
| 58 | + sanitized-branch: ${{ steps.branch.outputs.sanitized }} |
57 | 59 | strategy: |
58 | 60 | fail-fast: false |
59 | 61 | matrix: |
|
76 | 78 | - name: Set up Docker Buildx |
77 | 79 | uses: docker/setup-buildx-action@v3 |
78 | 80 |
|
| 81 | + - name: Sanitize branch name |
| 82 | + id: branch |
| 83 | + run: | |
| 84 | + BRANCH_NAME="${{ github.ref_name }}" |
| 85 | + SANITIZED_BRANCH=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9.-]/-/g') |
| 86 | + echo "sanitized=$SANITIZED_BRANCH" >> $GITHUB_OUTPUT |
| 87 | +
|
79 | 88 | - name: Log in to GitHub Container Registry |
80 | 89 | uses: docker/login-action@v3 |
81 | 90 | with: |
|
89 | 98 | with: |
90 | 99 | images: ghcr.io/nvidia/cutile-python/ci-py${{ matrix.python-version }} |
91 | 100 | tags: | |
92 | | - type=sha,prefix={{branch}}- |
| 101 | + type=sha,prefix=${{ steps.branch.outputs.sanitized }}- |
93 | 102 |
|
94 | 103 | - name: Check disk space before build |
95 | 104 | run: df -h |
@@ -143,7 +152,7 @@ jobs: |
143 | 152 | if: needs.check-changes.outputs.source-changed == 'true' |
144 | 153 | timeout-minutes: 30 |
145 | 154 | container: |
146 | | - image: ghcr.io/nvidia/cutile-python/ci-py${{ matrix.python-version }}:${{ github.ref_name }}-${{ github.sha }} |
| 155 | + image: ghcr.io/nvidia/cutile-python/ci-py${{ matrix.python-version }}:pull-request-1-${{ github.sha }} |
147 | 156 | credentials: |
148 | 157 | username: ${{ github.actor }} |
149 | 158 | password: ${{ secrets.GITHUB_TOKEN }} |
@@ -176,7 +185,7 @@ jobs: |
176 | 185 | if: always() && (needs.check-changes.outputs.source-changed == 'true' || needs.check-changes.outputs.docs-changed == 'true') |
177 | 186 | timeout-minutes: 15 |
178 | 187 | container: |
179 | | - image: ghcr.io/nvidia/cutile-python/ci-py3.10:${{ github.ref_name }}-${{ github.sha }} |
| 188 | + image: ghcr.io/nvidia/cutile-python/ci-py3.10:${{ needs.build-ci-images.outputs.sanitized-branch }}-${{ github.sha }} |
180 | 189 | credentials: |
181 | 190 | username: ${{ github.actor }} |
182 | 191 | password: ${{ secrets.GITHUB_TOKEN }} |
|
0 commit comments