Skip to content

Commit 14b6899

Browse files
authored
Overlay Dockerfile from main on backfill runs (#53)
Pre-existing tags (v1.1.0 .. v1.13.5) were created before the Dockerfile landed on main, so checking them out gives no Dockerfile and the build fails. On workflow_dispatch runs, fetch main and check out the current Dockerfile + .dockerignore over the tag's source tree. Push-triggered runs are unaffected -- they get the Dockerfile from the tag itself.
1 parent 2a7c04a commit 14b6899

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/docker.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ jobs:
5858
- uses: actions/checkout@v4
5959
with:
6060
ref: ${{ steps.ref.outputs.ref }}
61+
fetch-depth: 0
62+
63+
- name: Overlay Dockerfile from main (backfill runs)
64+
# Tags published before Docker support was added don't have a Dockerfile.
65+
# On workflow_dispatch backfills, copy the current Dockerfile + .dockerignore
66+
# from main on top of the tag's source tree so old releases can still be built.
67+
if: github.event_name == 'workflow_dispatch'
68+
run: |
69+
git fetch origin main --depth=1
70+
git checkout origin/main -- Dockerfile .dockerignore
6171
6272
- name: Set up QEMU
6373
uses: docker/setup-qemu-action@v3

0 commit comments

Comments
 (0)