superfly / flyctl-actions

:octocat: GitHub Action that wraps the flyctl
Apache License 2.0
260 stars 33 forks source link

Build fails with issues running ssh console #13

Closed kulor closed 2 years ago

kulor commented 2 years ago

This snippet of Github action config has just started failing:

...
- uses: superfly/flyctl-actions@master
        env:
          FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
        with:
          args: "ssh console --command 'sh /app/build/scripts/post_deploy.sh'"

with the following error message:

sh: console: unknown operand
Error: unknown flag: --remote-only
Error unknown flag: --remote-only

Usage:
  flyctl ssh console [<host>] [flags]

Flags:
  -a, --app string       App name to operate on
  -C, --command string   command to run on SSH session
  -c, --config string    Path to an app config file or directory containing one (default "./fly.toml")
  -h, --help             help for console
  -p, --probe            test WireGuard connection after establishing
  -r, --region string    Region to create WireGuard connection in
  -s, --select           select available instances

Global Flags:
  -t, --access-token string   Fly API Access Token
  -j, --json                  json output
      --verbose               verbose output

Running the aforementioned script directly on the CLI fly ssh console --command 'sh /app/build/scripts/post_deploy.sh' works as expected (whilst using the latest flyctl) so it seems specific to this action.

kulor commented 2 years ago

Can see the issue stems from https://github.com/superfly/flyctl-actions/commit/372a8fcc09d83f0210be78687813a9ef4cfde339 which assumes it'll be invoking a deploy.

charsleysa commented 2 years ago

Also seem to be getting the following message in our builds: sh: --config: unknown operand

mveytsman commented 2 years ago

There's a related issue in that using --local-deploy will never succeed at all. I have a fix for it it in #15

@charsleysa I think my fix addresses your issue as well. You can verify by specifying uses: mveytsman/flyctl-actions@patch-1 in your workflow.

jsierles commented 2 years ago

Thanks for the contributions. The fixes were merged in #14 and #15.