Skip to content

[WIP] Add cleanup step to remove existing attestation files#26

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/add-cleanup-step-for-attestations
Closed

[WIP] Add cleanup step to remove existing attestation files#26
Copilot wants to merge 1 commit intomainfrom
copilot/add-cleanup-step-for-attestations

Conversation

Copy link

Copilot AI commented Dec 6, 2025

Plan: Add cleanup step for attestation files in publish-to-test-pypi.yaml workflow

  • Understand the problem: The workflow fails when publish attestation files already exist
  • Review the current workflow file structure
  • Add cleanup step before the "Publish to Test PyPI" step to remove existing .publish.attestation files
  • Add cleanup step before the "Publish to PyPI" step to remove existing .publish.attestation files
  • Verify the workflow syntax is correct
  • Run code review
  • Run security scan (codeql_checker)
  • Complete the task
Original prompt

On publish-to-test-pypi.yaml, GitHub Copilot Chat Assistant — Suggested change:

Problem: the job fails because publish attestation files already exist for the artifacts: dist/*.publish.attestation

Fix: add a small cleanup step in the workflow to remove existing attestation files before the attestation generation step.

Edit: .github/workflows/publish-to-test-pypi.yaml (at ref f707592) Link: https://github.com/eriknovak/datachart/blob/f707592772b40e6618f3e57fdefd6d1e03ebee95/.github/workflows/publish-to-test-pypi.yaml

Insert the following step immediately before the attestation-generation / publish step:

YAML

  • name: Remove existing publish attestations
    run: |
    echo "Checking dist/ contents:"
    ls -la dist || true
    echo "Removing any existing .publish.attestation files"
    rm -f dist/*.publish.attestation || true
    shell: bash
    Notes and rationale

rm -f is safe and idempotent: it will not fail if no files exist.
The ls -la helps debugging in CI logs to confirm what's present before removal.
This is the simplest fix; alternatively you could make the attestation generation step skip files that already have attestations, but that requires changing the attestation tool invocation.
If you want, I can create a suggested patch/diff you can copy into the workflow or prepare a PR for you — tell me whether you want a patch or that I should open a PR.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI requested a review from eriknovak December 6, 2025 13:37
@eriknovak eriknovak closed this Dec 6, 2025
@eriknovak eriknovak deleted the copilot/add-cleanup-step-for-attestations branch December 6, 2025 13:40
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