fix(ci): matrix context broke npm-release workflow parsing - #58
Merged
Conversation
Job-level 'if' cannot reference the matrix context (only github, inputs, needs, vars are available there), so GitHub rejected the workflow file and every run failed before any job started — visible as runs named '.github/workflows/npm-release.yml' with no jobs. Replace the matrix with two explicit jobs (release-code / release-pm), each gated by its own tag prefix or dispatch checkbox.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #57 was merged at
7fafb53, before the final fix commit landed on its branch — somainstill carries the brokennpm-release.ymland every trigger fails instantly with a run named.github/workflows/npm-release.yml(no jobs, "workflow file issue").Root cause (unchanged from the discussion in #57): the job-level
if:referenced${{ matrix.* }}, but thematrixcontext is not available in job-level conditions (onlygithub,inputs,needs,vars), so GitHub rejected the whole workflow file.Fix: replace the matrix with two explicit jobs (
release-code/release-pm), each gated by its own tag prefix (refs/tags/code-v*/refs/tags/pm-v*) or dispatch checkbox. Dispatch input is now two booleans (code/pm).Validated with actionlint locally.
Test plan
actionlint .github/workflows/npm-release.ymlcleanpm-v2.4.1-test) or run via workflow_dispatch to confirm jobs start; delete the release if desired