fix(shared/apm.md): drop || 'all' fallback so gh-aw substitutes target (#1185)#1186
Merged
Merged
Conversation
#1185) The bare-expression regex in gh-aw's importInputsExprRegex (pkg/parser/import_field_extractor.go) only matches `${{ github.aw.import-inputs.X }}`. The `|| 'all'` belt-and-suspenders introduced in #1184 made the regex skip substitution entirely, so consumer-supplied `with: target: copilot` was silently ignored: the unresolved expression survived into the lock workflow and the runtime env was empty (which apm-action then treated as `all`). The schema default `default: all` declared in import-schema is already applied by gh-aw's applyImportSchemaDefaultsFromFrontmatter BEFORE substitution, so the fallback was redundant. Dropping it lets gh-aw substitute literal values into consuming lock workflows. Recompiled with gh-aw v0.71.5 (matching the version stamped in lock metadata). The two consuming lock workflows now carry the literal substituted value `target: all` since neither import sets `target:`. Consumers who pass `with: target: copilot` will get `target: copilot`. Closes #1185. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes gh-aw import-input substitution for the shared APM workflow by removing a non-bare expression fallback that prevented compile-time replacement of target, ensuring consumer-provided with: target: ... values flow through correctly.
Changes:
- Remove the
|| 'all'fallback fromtarget: ${{ github.aw.import-inputs.target ... }}inshared/apm.mdso gh-aw can substitute the value. - Regenerate lock workflows so the default schema value compiles to a literal
target: all. - Add a changelog entry describing the fix.
Show a summary per file
| File | Description |
|---|---|
CHANGELOG.md |
Adds an Unreleased “Fixed” entry for the gh-aw substitution compatibility fix. |
.github/workflows/shared/apm.md |
Updates the apm-action invocation to use a bare github.aw.import-inputs.target expression for gh-aw substitution. |
.github/workflows/pr-review-panel.lock.yml |
Regenerated compiled workflow now contains literal target: all (schema default applied). |
.github/workflows/triage-panel.lock.yml |
Regenerated compiled workflow now contains literal target: all (schema default applied). |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 1
|
|
||
| ### Fixed | ||
|
|
||
| - `shared/apm.md` no longer wraps the `target` input in a `|| 'all'` fallback. The defensive expression broke gh-aw's bare-expression substitution regex, causing consumer-supplied `target:` values to be silently dropped; the `import-schema` default already covers the omitted-input case. (#1185) |
danielmeppiel
added a commit
to DevExpGbb/zava-storefront
that referenced
this pull request
May 7, 2026
…+ triage) (#3) Brings DevExpGbb/zava-storefront to current shipping state: - v5.0.1 marketplace pins (5 kits) - PR Review Panel gh-aw workflow (review-kit panel skill) - Triage Panel gh-aw workflow - shared/apm.md from microsoft/apm@main (post #1186 fix) - .github/aw/actions-lock.json All apm.yml + workflow .md/.lock.yml refs rewritten from hackathon-white-pig-8 → DevExpGbb (canonical home). Source: hackathon-white-pig-8/zava-storefront@main HEAD (PR #6 merged green E2E with apm-action v1.7.2 + microsoft/apm#1186 + gh-aw v0.72.0). Co-authored-by: Daniel Meppiel <dmeppiel@github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
sergio-sisternes-epam
pushed a commit
that referenced
this pull request
May 19, 2026
#1185) (#1186) The bare-expression regex in gh-aw's importInputsExprRegex (pkg/parser/import_field_extractor.go) only matches `${{ github.aw.import-inputs.X }}`. The `|| 'all'` belt-and-suspenders introduced in #1184 made the regex skip substitution entirely, so consumer-supplied `with: target: copilot` was silently ignored: the unresolved expression survived into the lock workflow and the runtime env was empty (which apm-action then treated as `all`). The schema default `default: all` declared in import-schema is already applied by gh-aw's applyImportSchemaDefaultsFromFrontmatter BEFORE substitution, so the fallback was redundant. Dropping it lets gh-aw substitute literal values into consuming lock workflows. Recompiled with gh-aw v0.71.5 (matching the version stamped in lock metadata). The two consuming lock workflows now carry the literal substituted value `target: all` since neither import sets `target:`. Consumers who pass `with: target: copilot` will get `target: copilot`. Closes #1185. Co-authored-by: Daniel Meppiel <copilot-rework@github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Closes #1185.
Problem
#1184 introduced a defensive
|| 'all'fallback on thetargetimport:That broke gh-aw's substitution. The
importInputsExprRegexinpkg/parser/import_field_extractor.goonly matches bare${{ github.aw.import-inputs.X }}. Anything inside the brackets (like|| 'all') makes the regex skip substitution entirely, so the unresolved expression was emitted verbatim into the consuming lock workflow. At runtimewith.targetwas empty, whichapm-actionthen interpreted asall-- silently ignoring whatever the consumer passed viawith: target: copilot.Fix
Drop the fallback. The schema default
default: alldeclared on thetargetinput is already applied by gh-aw'sapplyImportSchemaDefaultsFromFrontmatterbefore substitution, so omitted-input behaviour is preserved without the belt-and-suspenders.Validation
Recompiled with
gh aw compilepinned to v0.71.5 (matching thecompiler_versionstamped in current lock metadata). Diff is exactly 3 files / 3 lines:shared/apm.md-- 1 line, drops the fallbackpr-review-panel.lock.yml-- gh-aw substituted the schema default in place; line now reads literaltarget: alltriage-panel.lock.yml-- sameConsumers who pass
with: target: copilotwill now gettarget: copilotsubstituted into their lock workflow.Follow-up (not in this PR)
It would be nice for
gh-awupstream to makeimportInputsExprRegextolerant of GHA-idiom||fallbacks, since this is a footgun. Worth filing ingithubnext/gh-aw.