Skip to content

failed when promote snap using option: --yes #4439

Closed

Description

@krille-chan

Bug Description

I want to promote a snap without confirmation, so i use --yes option from the edge channel. Without this I cannot promote my snap in github actions.

This reopens #4312 as this is not solved for me.

To Reproduce

snapcraft promote SNAP_NAME --from-channel latest/edge --to-channel latest/candidate --yes

then i got

Error: 'latest/edge' is not a valid set value for --from-channel when using --yes.

Environment

Ubuntu 23.04
snapcraft 7.5.2

snapcraft.yaml

no

Relevant log output

no log

Additional context

No response

Activity

  1. sergiusens commented on Nov 30, 2023

    @sergiusens
    Contributor

    Interesting, can you provide the output of status for this snap?

  2. kissiel commented on Dec 6, 2023

    @kissiel

    Same problem, here's mine:

    ❯ snapcraft promote --yes --from-channel 'latest/edge' --to-channel 'latest/beta' kissiel-hello2
    snapcraft promote does not have a stable CLI interface. Use with caution in scripts.
    Usage: snapcraft promote [OPTIONS] <snap-name>
    Try 'snapcraft promote -h' for help.
    
    Error: 'latest/edge' is not a valid set value for --from-channel when using --yes.
    
    ~ via 🐍 v3.11.6 
    ❯ snapcraft status kissiel-hello2
    Track    Arch    Channel    Version    Revision    Progress
    latest   amd64   stable     -          -           -
                     candidate  -          -           -
                     beta       -          -           -
                     edge       0.1.2      1           -    
    
  3. Hook25 commented on Dec 6, 2023

    @Hook25

    We have this workaround, not perfect at all but it works for now:
    https://github.com/canonical/checkbox/pull/877/files

    This is possibly related to this line in snapcraft: https://github.com/snapcore/snapcraft/blob/662af4c00fb43b97b87eef16f4edbba4ff12a1cf/snapcraft_legacy/cli/store.py#L164

    Makes me think it is intentional, probably we want a different error message, something like

    Error: we don't allow to promote un-branched edge channels with no user interaction
    
  4. bepri commented on Jan 8, 2026

    @bepri
    Member

    Thanks for the report, @krille-chan :)

    This issue is rather old now, but has been reported again at #5945. Since that issue has more context, I'm closing this as a duplicate.

  5. mr-cal commented on Jun 15, 2026

    @mr-cal
    Collaborator

    This has been fixed in Snapcraft 9.0.

    Anyone using workarounds in a Github workflow like this:

    env:
        SNAPCRAFT_HAS_TTY: "true"
    run: |
      yes | snapcraft promote <snap-name> --from-channel latest/edge --to-channel latest/beta

    can use the --yes flag instead:

    run: |
      snapcraft promote <snap-name> --from-channel latest/edge --to-channel latest/beta --yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions