Skip to content

Commit 726675c

Browse files
authored
ci: support running docker-release in upper case user fork (#258)
Signed-off-by: bitliu <[email protected]>
1 parent 5526456 commit 726675c

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

.github/workflows/docker-publish.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,15 @@ jobs:
4040
if: inputs.is_nightly == true
4141
run: echo "date_tag=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
4242

43+
- name: Set lowercase repository owner
44+
run: echo "REPOSITORY_OWNER_LOWER=$(echo $GITHUB_REPOSITORY_OWNER | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
45+
4346
- name: Build and push Docker image
4447
uses: docker/build-push-action@v5
4548
with:
4649
context: .
4750
file: ./Dockerfile.extproc
4851
push: ${{ github.event_name != 'pull_request' }} # Only push on merge to main, not on PRs
4952
tags: |
50-
${{ inputs.is_nightly == true && format('ghcr.io/{0}/semantic-router/extproc:nightly-{1}', github.repository_owner, steps.date.outputs.date_tag) || format('ghcr.io/{0}/semantic-router/extproc:{1}', github.repository_owner, github.sha) }}
51-
${{ inputs.is_nightly != true && format('ghcr.io/{0}/semantic-router/extproc:latest', github.repository_owner) || '' }}
53+
${{ inputs.is_nightly == true && format('ghcr.io/{0}/semantic-router/extproc:nightly-{1}', env.REPOSITORY_OWNER_LOWER, steps.date.outputs.date_tag) || format('ghcr.io/{0}/semantic-router/extproc:{1}', env.REPOSITORY_OWNER_LOWER, github.sha) }}
54+
${{ inputs.is_nightly != true && format('ghcr.io/{0}/semantic-router/extproc:latest', env.REPOSITORY_OWNER_LOWER) || '' }}

.github/workflows/docker-release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ jobs:
2020
id: extract_tag
2121
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
2222

23+
- name: Set lowercase repository owner
24+
run: echo "REPOSITORY_OWNER_LOWER=$(echo $GITHUB_REPOSITORY_OWNER | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
25+
2326
- name: Log in to GitHub Container Registry
2427
uses: docker/login-action@v3
2528
with:
@@ -34,5 +37,5 @@ jobs:
3437
file: ./Dockerfile.extproc
3538
push: true
3639
tags: |
37-
ghcr.io/${{ github.repository_owner }}/semantic-router/extproc:${{ steps.extract_tag.outputs.tag }}
38-
ghcr.io/${{ github.repository_owner }}/semantic-router/extproc:latest
40+
ghcr.io/${{ env.REPOSITORY_OWNER_LOWER }}/semantic-router/extproc:${{ steps.extract_tag.outputs.tag }}
41+
ghcr.io/${{ env.REPOSITORY_OWNER_LOWER }}/semantic-router/extproc:latest

.github/workflows/precommit-publish.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jobs:
1919
- name: Check out the repo
2020
uses: actions/checkout@v4
2121

22+
- name: Set lowercase repository owner
23+
run: echo "REPOSITORY_OWNER_LOWER=$(echo $GITHUB_REPOSITORY_OWNER | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
24+
2225
- name: Log in to GitHub Container Registry
2326
uses: docker/login-action@v3
2427
with:
@@ -38,4 +41,4 @@ jobs:
3841
file: ./Dockerfile.precommit
3942
push: ${{ github.event_name != 'pull_request' }} # Only push on merge to main, not on PRs
4043
tags: |
41-
${{ inputs.is_nightly != true && format('ghcr.io/{0}/semantic-router/precommit:latest', github.repository_owner) || '' }}
44+
${{ inputs.is_nightly != true && format('ghcr.io/{0}/semantic-router/precommit:latest', env.REPOSITORY_OWNER_LOWER) || '' }}

0 commit comments

Comments
 (0)