Skip to content

publish deploy fails on re-run: duplicate github-pages artifact #1328

Description

@daira

Symptom

Re-running the failed render-and-deploy job in Deploy Rendered Site
(.github/workflows/publish.yaml) fails at the Deploy to GitHub Pages step
(actions/deploy-pages@v5) with:

Error: Multiple artifacts named "github-pages" were unexpectedly found for this workflow run. Artifact count is 2.

Root cause

The Upload artifact step uses actions/upload-pages-artifact@v5, which
uploads an artifact named github-pages. Artifacts are scoped to the workflow
run, not the attempt, and persist across attempts. So re-running the job
creates a second github-pages artifact for the same run, and
actions/deploy-pages — which requires exactly one — aborts.

The action's own hint ("Please re-run the deployment at a later time") is
misleading here: re-running is precisely what creates the duplicate, so a
plain "Re-run failed jobs" never self-heals. The stale artifact must be deleted
by hand first.

Evidence

Run 28734687994 (the
publish for #1323, protocol spec 2026.7.0) had two github-pages artifacts:

artifact id created
8090060529 2026-07-05T08:40:03Z (original attempt)
8090483436 2026-07-05T09:36:18Z (re-run)

Deleting both and re-running the job succeeded.

Proposed fix

Make the job self-healing by deleting any pre-existing github-pages artifact
for the current run before the upload. upload-pages-artifact@v5 has no
overwrite input, so a dedicated cleanup step is needed — inserted immediately
before the Upload artifact step:

      - name: Delete any stale `github-pages` artifact from a previous attempt
        uses: actions/github-script@<pin to a v7 SHA>
        with:
          script: |
            const { data } = await github.rest.actions.listWorkflowRunArtifacts({
              owner: context.repo.owner,
              repo: context.repo.repo,
              run_id: context.runId,
              name: 'github-pages',
            });
            for (const artifact of data.artifacts) {
              core.info(`Deleting stale artifact ${artifact.id}`);
              await github.rest.actions.deleteArtifact({
                owner: context.repo.owner,
                repo: context.repo.repo,
                artifact_id: artifact.id,
              });
            }

With that in place, "Re-run failed jobs" works without manual artifact cleanup.

🤖 Claude Opus 4.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    filed using AIIssue or PR filed with the assistance of an AI coding assistant

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions