Skip to content

Conversation

@kevinbackhouse
Copy link
Collaborator

Second attempt at fixing these workflows. (I've closed #51.)

Copilot AI review requested due to automatic review settings November 5, 2025 18:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the GitHub Actions publishing workflows to eliminate the manual version input requirement and instead rely on git references for release tagging. The workflows now use github.ref_name and github.head_ref context variables to automatically determine release versions.

Key changes:

  • Removed manual version input parameter from both the caller and reusable workflows
  • Split the environment configuration in the reusable workflow to accept separate environment_name and environment_url parameters
  • Updated GitHub release commands to use $GITHUB_REFNAME environment variable instead of explicit version input

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/publish-to-testpypi.yaml Removed manual version input, updated to pass separate environment_name and environment_url parameters
.github/workflows/publish-reusable.yml Removed version parameter, added GITHUB_REFNAME env var, split environment config to accept name and url separately

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 5, 2025 19:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

version:
description: 'Version name for release'
required: true
on: push
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Publishing to TestPyPI on every push to any branch will create numerous releases and may quickly exhaust rate limits. Consider restricting this to specific branches (e.g., main or develop) or adding path filters to prevent unintended publishing.

Suggested change
on: push
on:
push:
branches:
- main
- develop

Copilot uses AI. Check for mistakes.
VERSION: ${{ inputs.version }}
NOTES: ${{ inputs.release_notes }}
run: gh release create $VERSION --repo $GITHUB_REPO --notes $NOTES
run: gh release create $GITHUB_REFNAME --repo $GITHUB_REPO --notes $NOTES
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gh release create command will fail if a release with the same tag already exists. When triggering on push events, GITHUB_REFNAME will be a branch name (e.g., main), not a version tag, which will cause conflicts. Consider adding a --clobber flag or checking if the release exists first, or ensure this only runs on tag pushes.

See below for a potential fix:

      if: startsWith(github.ref, 'refs/tags/')
      env:
        NOTES: ${{ inputs.release_notes }}
      run: gh release create $GITHUB_REFNAME --repo $GITHUB_REPO --notes "$NOTES" --clobber

Copilot uses AI. Check for mistakes.
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.

1 participant