Skip to content

Commit d28bd46

Browse files
committed
Lowercase repo name in docker workflow. Improves output of mirror workflow
1 parent 8eff29a commit d28bd46

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

.github/workflows/docker.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222

2323
env:
2424
REPO_NAME: ${{ github.repository }}
25+
REPO_LOWER: ${{ github.repository_owner }}/networking-toolbox
2526

2627
jobs:
2728
build:
@@ -50,15 +51,15 @@ jobs:
5051
if [[ "${{ github.event_name }}" == "workflow_dispatch" && -n "${{ inputs.tag }}" ]]; then
5152
# Manual dispatch with custom tag
5253
TAG="${{ inputs.tag }}"
53-
TAGS="docker.io/${{ env.REPO_NAME }}:${TAG},ghcr.io/${{ env.REPO_NAME }}:${TAG}"
54+
TAGS="docker.io/${{ env.REPO_LOWER }}:${TAG},ghcr.io/${{ env.REPO_LOWER }}:${TAG}"
5455
elif [[ "${{ github.ref_type }}" == "tag" ]]; then
5556
# Git tag push
5657
TAG="${{ github.ref_name }}"
5758
TAG="${TAG#v}" # Remove v prefix
58-
TAGS="docker.io/${{ env.REPO_NAME }}:${TAG},ghcr.io/${{ env.REPO_NAME }}:${TAG}"
59+
TAGS="docker.io/${{ env.REPO_LOWER }}:${TAG},ghcr.io/${{ env.REPO_LOWER }}:${TAG}"
5960
elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
6061
# Main branch push
61-
TAGS="docker.io/${{ env.REPO_NAME }}:latest,ghcr.io/${{ env.REPO_NAME }}:latest"
62+
TAGS="docker.io/${{ env.REPO_LOWER }}:latest,ghcr.io/${{ env.REPO_LOWER }}:latest"
6263
fi
6364
6465
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
@@ -83,7 +84,7 @@ jobs:
8384
id: meta
8485
uses: docker/metadata-action@v5
8586
with:
86-
images: ghcr.io/${{ env.REPO_NAME }}
87+
images: ghcr.io/${{ env.REPO_LOWER }}
8788
tags: |
8889
type=raw,value=${{ steps.tags.outputs.tags }}
8990
labels: |

.github/workflows/mirror.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ on:
2525
repo: { description: 'Repository name (default: current repo name)' }
2626

2727
jobs:
28-
codeberg:
28+
mirror:
2929
runs-on: ubuntu-latest
3030
env: # Get values for target repo from inputs, env vars, or fallback to defaults
3131
MIRROR_HOST: ${{ inputs.host || vars.MIRROR_HOST || '[email protected]' }}
3232
MIRROR_USER: ${{ inputs.user || vars.MIRROR_USER || 'alicia' }}
3333
MIRROR_REPO: ${{ inputs.repo || vars.MIRROR_REPO || github.event.repository.name }}
3434
HAS_SSH: ${{ secrets.MIRROR_SSH != '' }}
3535
steps:
36-
- name: Cancel if SSH key not set
36+
- name: ⏭️ Cancel if SSH key not set
3737
if: env.HAS_SSH != 'true'
3838
run: echo "::warning::MIRROR_SSH secret not set" && exit 1
3939

40-
- name: Checkout source repository
40+
- name: ⤵️ Checkout source repository
4141
uses: actions/checkout@v4
4242
with: { fetch-depth: 0 }
4343

44-
- name: Mirror repository to target
44+
- name: 🔁 Mirror repository to target
4545
id: mirror
4646
run: |
4747
set -euo pipefail
@@ -61,7 +61,7 @@ jobs:
6161
git push mirror --tags
6262
} |& tee "$LOG"
6363
64-
- name: Summarize
64+
- name: ⤵️ Summarize
6565
if: always()
6666
continue-on-error: true
6767
run: |
@@ -75,8 +75,8 @@ jobs:
7575
fi
7676
if [ "${{ steps.mirror.outcome }}" = "success" ]; then
7777
{
78-
echo "✅ **Completed**.<br>_You can now access the repository at_ \`${TARGET}\` 🥳"
79-
echo; echo '```'; (tail -n 200 "$LOG" || true); echo '```'
78+
echo "✅ **Completed**.<br>_You can now access the repository at_ \`${TARGET}\` 🥳<br>"
79+
echo; echo '<details><summary>Output</summary><pre>'; (tail -n 200 "$LOG" || true); echo '</pre></details>'
8080
} >> "$GITHUB_STEP_SUMMARY"
8181
else
8282
{

0 commit comments

Comments
 (0)