Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/patch-update-apm-action-version.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions .github/aw/actions-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,6 @@
"version": "v2.10.3",
"sha": "9cd1b7bf3f36d5a3c3b17abc3545bfb5481912ea"
},
"microsoft/apm-action@v1.4.0": {
"repo": "microsoft/apm-action",
"version": "v1.4.0",
"sha": "cc84c04bc73e19e35527f1efa34ea003be9f037f"
},
"oven-sh/setup-bun@v2.2.0": {
"repo": "oven-sh/setup-bun",
"version": "v2.2.0",
Expand All @@ -182,6 +177,11 @@
"repo": "super-linter/super-linter",
"version": "v8.5.0",
"sha": "61abc07d755095a68f4987d1c2c3d1d64408f1f9"
},
"microsoft/apm-action@v1.4.1": {
"repo": "microsoft/apm-action",
"version": "v1.4.1",
"sha": "a190b0b1a91031057144dc136acf9757a59c9e4d"
}
}
}
2 changes: 1 addition & 1 deletion .github/workflows/smoke-claude.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,9 @@ var SerenaLanguageSupport = map[string][]string{
},
}

// DefaultAPMActionVersion is the default version of the microsoft/apm-action GitHub Action
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The constant DefaultAPMActionVersion follows the same pattern as DefaultGitHubScriptVersion. Consider adding a brief comment linking to the upstream release notes or changelog so future reviewers can quickly verify what changed between versions.

const DefaultAPMActionVersion Version = "v1.4.1"

// DefaultAPMVersion is the default version of the microsoft/APM (Agent Package Manager) CLI
const DefaultAPMVersion Version = "v0.8.5"

Expand Down
7 changes: 6 additions & 1 deletion pkg/workflow/apm_dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"sort"

"github.com/github/gh-aw/pkg/constants"
"github.com/github/gh-aw/pkg/logger"
)

Expand Down Expand Up @@ -131,7 +132,11 @@ func GenerateAPMPackStep(apmDeps *APMDependenciesInfo, target string, data *Work

apmDepsLog.Printf("Generating APM pack step: %d packages, target=%s", len(apmDeps.Packages), target)

actionRef := GetActionPin("microsoft/apm-action")
actionRef, err := GetActionPinWithData("microsoft/apm-action", string(constants.DefaultAPMActionVersion), data)
if err != nil {
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetActionPinWithData can return an empty actionRef with err == nil when it can’t pin the requested version (e.g., strict mode with no exact match, or repo not present in pins). This code only falls back on err != nil, so you can end up emitting uses: (empty) which produces invalid workflow YAML. Handle actionRef == "" as a failure case too, and fall back to a safe reference (e.g., repo@DefaultAPMActionVersion or GetActionPin(...)) while still logging the warning.

Suggested change
if err != nil {
if err != nil || actionRef == "" {

Copilot uses AI. Check for mistakes.
apmDepsLog.Printf("Failed to resolve microsoft/apm-action@%s: %v", constants.DefaultAPMActionVersion, err)
actionRef = GetActionPin("microsoft/apm-action")
}

lines := []string{
" - name: Install and pack APM dependencies",
Expand Down
10 changes: 5 additions & 5 deletions pkg/workflow/data/action_pins.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,6 @@
"version": "v2.10.3",
"sha": "9cd1b7bf3f36d5a3c3b17abc3545bfb5481912ea"
},
"microsoft/apm-action@v1.4.0": {
"repo": "microsoft/apm-action",
"version": "v1.4.0",
"sha": "cc84c04bc73e19e35527f1efa34ea003be9f037f"
},
"oven-sh/setup-bun@v2.2.0": {
"repo": "oven-sh/setup-bun",
"version": "v2.2.0",
Expand All @@ -182,6 +177,11 @@
"repo": "super-linter/super-linter",
"version": "v8.5.0",
"sha": "61abc07d755095a68f4987d1c2c3d1d64408f1f9"
},
"microsoft/apm-action@v1.4.1": {
"repo": "microsoft/apm-action",
"version": "v1.4.1",
"sha": "a190b0b1a91031057144dc136acf9757a59c9e4d"
}
}
}