Skip to content

Agentic Plan: Improve gh aw upgrade warning for github/gh-aw-actions/setup when no GitHub Releases exist #23083

@grahame-white

Description

@grahame-white

Analysis

When running gh aw upgrade, users see this warning:

github/gh-aw-actions/setup: no releases found

Root cause:

  • pkg/cli/update_actions.go:getLatestActionRelease calls the GitHub Releases API for the repo (after base extraction, e.g. github/gh-aw-actions).
  • If there are no Releases (even if there are tags), the API returns [].
  • Code then does:
releases := strings.Split(strings.TrimSpace(string(output)), "\n")
if len(releases) == 0 || releases[0] == "" {
    return "", "", errors.New("no releases found")
}
  • This causes the warning. The fallback to tag scanning with git ls-remote is only used for authentication errors, not for empty results.

Key snippet from getLatestActionRelease:

output, err := workflow.RunGHCombined("Fetching releases...", "api", fmt.Sprintf("/repos/%s/releases", baseRepo), "--jq", ".[].tag_name")
if err != nil {
    // fallback logic for auth errors
}
releases := strings.Split(strings.TrimSpace(string(output)), "\n")
if len(releases) == 0 || releases[0] == "" {
    return "", "", errors.New("no releases found")
}

Implementation Plan

  1. Enhance Fallback in getLatestActionRelease

    • If the releases list is empty and there was no error, fallback to getLatestActionReleaseViaGit (listing tags, as is done for auth errors).
    • Only produce a warning if neither approach finds tags or releases.
    • Warnings must make it clear to users if it is safe to ignore them or not
  2. Console Formatting

    • Use pkg/console.FormatWarningMessage for any fallback messages and clarify if tags were found and used, or nothing was found at all.
  3. Update Tests

    • In pkg/workflow/compiler_custom_actions_test.go, add/extend tests to verify: (a) fallback to tags happens on empty releases, (b) proper warnings.
  4. Improve Docs

    • Document in the FAQ how action version resolution works with regards to Releases vs tags and how upgrades behave if only tags exist.
  5. Validate per Project Guidelines

    • Run make agent-finish.
    • Use correct error/console formatting (pkg/console).

References:

Labels: bug, type: bug, actions, release

cc @github/gh-aw-core-team

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions