Skip to content

Fix release workflow: replace unresolvable github/copilot-models@latest#4

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-github-actions-job
Draft

Fix release workflow: replace unresolvable github/copilot-models@latest#4
Copilot wants to merge 2 commits intomainfrom
copilot/fix-github-actions-job

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

github/copilot-models@latest is not a valid action ref — GitHub Actions fails at workflow preparation time before any steps execute. Replaced with a shell step that defaults the bump type to patch when no major/minor/patch PR label is present.

Changes

  • .github/workflows/release.yml
    • Replace uses: github/copilot-models@latest with a run step that writes bump_type=patch to $GITHUB_OUTPUT
    • Drop models: read permission (no longer needed)
# Before
- name: Fallback to Copilot if no label
  id: bump
  if: steps.pr.outputs.number != '' && steps.labels.outputs.bump == ''
  uses: github/copilot-models@latest
  with:
    model: gpt-4o
    prompt: |
      ...
    output-variable: bump_type

# After
- name: Fallback to patch if no label
  id: bump
  if: steps.pr.outputs.number != '' && steps.labels.outputs.bump == ''
  run: echo "bump_type=patch" >> "$GITHUB_OUTPUT"

Step id and output variable name are unchanged, so the downstream Calculate new version step (steps.bump.outputs.bump_type) requires no modification.

Original prompt

Fix failing GitHub Actions job in 50ButtonsEach/pyflic-ble.

Failing run/job:

Root cause:

  • Workflow .github/workflows/release.yml references uses: github/copilot-models@latest in the step “Fallback to Copilot if no label”, which fails because the action doesn’t provide a latest tag.

Required changes:

  1. Update .github/workflows/release.yml to pin github/copilot-models to a valid, stable version tag (preferably a commit SHA; acceptable: a documented release tag like v1).
  2. Ensure the step output still works (the workflow expects steps.bump.outputs.bump_type).
  3. Keep permissions and existing workflow behavior intact.
  4. If the action’s valid tag can’t be confidently determined, implement a safe fallback that avoids the action entirely and defaults bump type to patch when no major|minor|patch label exists.

Acceptance criteria:

  • Workflow no longer fails during “Prepare all required actions”.
  • Release workflow continues to determine a bump type reliably.
  • YAML remains valid.

Files:

  • .github/workflows/release.yml at ref a9d12f7 (update in main branch).

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.

Assistant: The job fails before any steps run because the workflow references an action version that doesn’t exist:

Unable to resolve action github/copilot-models@latest, unable to find version latest

This comes from .github/workflows/release.yml at commit a9d12f7cc313fe95bb11e01df432779ddcf0a4fa, step “Fallback to Copilot if no label”:

- name: Fallback to Copilot if no label
  id: bump
  if: steps.pr.outputs.number != '' && steps.labels.outputs.bump == ''
  uses: github/copilot-models@latest

Fix (recommended): pin to a valid tag/SHA (don’t use latest)

Update the action reference to a real released tag (or, best practice, a commit SHA). For example:

- name: Fallback to Copilot if no label
  id: bump
  if: steps.pr.outputs.number != '' && steps.labels.outputs.bump == ''
  uses: github/copilot-models@v1
  with:
    model: gpt-4o
    prompt: |
      ...
    output-variable: bump_type

If v1 is not the correct tag for that action, replace it with whatever tag the action actually publishes (or pin to the exact commit SHA from the action’s releases).

Fix (alternative / simplest): remove the Copilot dependency and default to patch

If you don’t strictly need Copilot-based bumping, you can make the workflow robust by defaulting to patch when no major|minor|patch label is present:

  1. Remove the Copilot step entirely.
  2. Change the bump selection in “Calculate new version”:
- name: Calculate new version
  if: steps.pr.outputs.number != ''
  id: newver
  run: |
    current="${{ steps.current.outputs.version }}"
    bump="${{ steps.labels.outputs.bump }}"
    bump="$(echo "${bump:-patch}" | tr -d '[:space:]' | tr '[:upper:]' '[:lower:]')"
    ...

This avoids external action resolution issues and still produces a deterministic version bump.

Why this solves the failing job

The run currently stops at workflow preparation time because GitHub Actions cannot fetch an action version called latest. Pinning to a real tag/SHA (or removing the action) eliminates the resolution error and allows the workflow to proceed to the actual release logic.

User: Please fix it

Assistant: We’re waiting on your approval of the proposed automated change so I can proceed to apply the fix and open the PR.

This pull request was created from Copilot chat.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Co-authored-by: alhia <46671090+alhia@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job in pyflic-ble Fix release workflow: replace unresolvable github/copilot-models@latest Mar 17, 2026
Copilot AI requested a review from alhia March 17, 2026 12:37
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