Skip to content

Fix package-and-publish failure on empty artifact repository#4

Closed
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-package-and-publish-job
Closed

Fix package-and-publish failure on empty artifact repository#4
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-package-and-publish-job

Conversation

Copilot AI commented Jun 8, 2026

Copy link
Copy Markdown

gh release create returns HTTP 422 ("Repository is empty") because GitHub requires at least one commit before a release can be attached. The mirror step that pushes the initial commit ran after the publish step, so the repo was always empty at publish time.

Changes

  • Reorder steps: "Mirror Zip Packages" now runs before "Publish Release", ensuring the artifact repo has at least one commit when gh release create is called
  • Handle empty-repo clone: --depth 1 fails fatally on a repo with no history; added a fallback to a full clone so the mirror step can initialize an empty repo
- name: Mirror Zip Packages Into Artifact Repository
  run: |
    if ! gh repo clone "$ARTIFACT_REPO" artifact-repo -- --depth 1 2>/dev/null; then
      gh repo clone "$ARTIFACT_REPO" artifact-repo
    fi
    ...

- name: Publish Release To Artifact Repository
  run: |
    gh release create ...

Copilot AI changed the title [WIP] Fix failing GitHub Actions job package-and-publish Fix package-and-publish failure on empty artifact repository Jun 8, 2026
Copilot AI requested a review from RicInNewMexico June 8, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants