fix: sync-output-repos workflow failing on tag pushes by Copilot · Pull Request #11016 · ember-cli/ember-cli · GitHub
Skip to content

fix: sync-output-repos workflow failing on tag pushes#11016

Merged
kategengler merged 2 commits into
masterfrom
copilot/fix-github-actions-tag-workflow
May 2, 2026
Merged

fix: sync-output-repos workflow failing on tag pushes#11016
kategengler merged 2 commits into
masterfrom
copilot/fix-github-actions-tag-workflow

Conversation

Copilot AI commented May 2, 2026

Copy link
Copy Markdown
Contributor

The verify-inputs step was appending -ember-cli to github.ref_name for all non-dispatch triggers — but tag names in this repo already include that suffix (e.g. v7.1.0-alpha.2-ember-cli), causing a doubled suffix and a broken npm version lookup.

Trace:

# Tag pushed: v7.1.0-alpha.2-ember-cli
# github.ref_name = "v7.1.0-alpha.2-ember-cli"

# Old logic:
TAG="${{github.ref_name}}-ember-cli"   # → "v7.1.0-alpha.2-ember-cli-ember-cli"

# Scripts strip only one trailing "-ember-cli":
version = tag.replace(/^v/, '').replace(/-ember-cli$/, '')
# → "7.1.0-alpha.2-ember-cli"  ← invalid npm version

# Result:
npx 'ember-cli@7.1.0-alpha.2-ember-cli'  # ETARGET – no such version

Changes

  • verify-inputs step: replace the generic github.ref_name != "" fallback with an explicit github.ref_type == 'tag' branch that uses github.ref_name directly, without re-appending -ember-cli.
  • push.tags filter: narrowed from v* to v*-ember-cli so the workflow only fires for ember-cli package tags and not for the other per-package tags (e.g. v*-@ember-tooling/*) that share the same repo.
Original prompt

Open a PR to fix the failing GitHub Actions workflow sync-output-repos.yml in ember-cli/ember-cli when runs are triggered on tags.

Context:

Task:

  1. Inspect the workflow and any scripts/actions it calls.
  2. Identify why tag refs cause failure (common causes: assumptions about github.ref_name being a branch, use of refs/heads/* parsing, checkout behavior for tags, version calculation expecting a branch name, or using GITHUB_REF/GITHUB_HEAD_REF incorrectly).
  3. Update the workflow (and any referenced scripts) so it works correctly for tag-triggered runs.
    • Ensure the logic correctly distinguishes between refs/tags/* and refs/heads/*.
    • If the workflow needs the associated commit SHA or default branch, use robust GitHub context variables.
    • Keep behavior unchanged for branch pushes.
  4. Add/adjust any tests or validation steps feasible for workflows (e.g., echo computed values, guard clauses) to prevent regressions.
  5. Ensure the workflow is still secure (no unsafe pull_request_target patterns; avoid untrusted input injection).

Acceptance criteria:

  • Workflow completes successfully on both branch pushes and tag pushes.
  • Any tag-specific logic is explicit and documented in comments.
  • PR includes a clear description of the fix and why it was needed.

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

User: This sync-output-repos job is failing on tags. Can you open a PR to fix it?

Assistant: I’ve kicked off the PR creation process, and we’re currently waiting on your confirmation in the approval dialog before I can proceed with investigating the failing tag runs and opening the fix PR.

This pull request was created from Copilot chat.

When a tag push fires (e.g. v7.1.0-alpha.2-ember-cli), github.ref_name
already contains the full tag name including the -ember-cli suffix.
The old verify-inputs step was blindly appending -ember-cli again,
producing the doubled tag v7.1.0-alpha.2-ember-cli-ember-cli.
The regex in the scripts only strips one trailing -ember-cli, so the
npm version resolved to "7.1.0-alpha.2-ember-cli", which does not exist
on the registry.

Fix:
- Use github.ref_type == 'tag' to detect tag-push runs and use
  github.ref_name directly (without appending the suffix again).
- Narrow push.tags filter from v* to v*-ember-cli so only the
  ember-cli package tags trigger this workflow.

Agent-Logs-Url: https://github.com/ember-cli/ember-cli/sessions/4c5503b9-afaa-4ccd-8a15-f0501be7ea4b

Co-authored-by: kategengler <444218+kategengler@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions workflow on tag triggers fix: sync-output-repos workflow failing on tag pushes May 2, 2026
Copilot AI requested a review from kategengler May 2, 2026 16:05
@kategengler kategengler marked this pull request as ready for review May 2, 2026 16:08
@kategengler kategengler merged commit 6da66e0 into master May 2, 2026
@kategengler kategengler deleted the copilot/fix-github-actions-tag-workflow branch May 2, 2026 16:08
@mansona mansona mentioned this pull request May 2, 2026
@mansona mansona mentioned this pull request May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants