Skip to content

Fix CI workflow errors: undefined variables and changesets on PRs#476

Merged
abernier merged 4 commits intomainfrom
copilot/fix-run-error
Jan 23, 2026
Merged

Fix CI workflow errors: undefined variables and changesets on PRs#476
abernier merged 4 commits intomainfrom
copilot/fix-run-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 23, 2026

CI workflow failing with two issues:

  1. error: src refspec v3.1.6 does not match any when pushing version tags
  2. HttpError: Validation Failed: {"resource":"PullRequest","field":"base","code":"invalid"} when changesets action tries to create release PR

Root Cause

Issue 1 - Git tags: Variables VERSION and MAJOR_VERSION were referenced before assignment in the bash script:

# vX tag
MAJOR_VERSION=${{ steps.get-version.outputs.major_version }}
git tag -fa v$VERSION -m "..."  # $VERSION not yet defined

# vX.Y.Z tag  
VERSION=${{ steps.get-version.outputs.version }}
git tag -fa v$MAJOR_VERSION -m "..."  # Wrong variable for this tag

Issue 2 - Changesets: The changesets action was running on pull requests and trying to create a release PR with an invalid base branch (refs/pull/476/merge).

Changes

Fix 1: Reordered to assign both variables before use:

# Set version variables
VERSION=${{ steps.get-version.outputs.version }}
MAJOR_VERSION=${{ steps.get-version.outputs.major_version }}

# vX.Y.Z tag
git tag -fa v$VERSION -m "..."

# vX tag
git tag -fa v$MAJOR_VERSION -m "..."

Fix 2: Added condition to only run changesets on main branch pushes:

- name: Create Release Pull Request or Publish
  id: changesets
  if: github.event_name == 'push' && github.ref == 'refs/heads/main'
  uses: changesets/action@v1
Original prompt

https://github.com/pmndrs/docs/actions/runs/21281805251/job/61253340342 fix this error


💡 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.

Co-authored-by: abernier <76580+abernier@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error in GitHub Actions workflow run Fix undefined variable reference in CI git tagging step Jan 23, 2026
Copilot AI requested a review from abernier January 23, 2026 10:14
@abernier
Copy link
Copy Markdown
Member

Co-authored-by: abernier <76580+abernier@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 23, 2026

@copilot err https://github.com/pmndrs/docs/actions/runs/21282697928/job/61256383966

Fixed in 624c499. The changesets action was trying to create a release PR while running on a pull request, causing it to use an invalid base branch. Added a condition to only run the changesets step on pushes to main.

Copilot AI changed the title Fix undefined variable reference in CI git tagging step Fix CI workflow errors: undefined variables and changesets on PRs Jan 23, 2026
@abernier abernier marked this pull request as ready for review January 23, 2026 10:28
@abernier abernier merged commit c0e0ac7 into main Jan 23, 2026
6 checks passed
@github-actions github-actions Bot mentioned this pull request Jan 23, 2026
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