TractorZoom / sam-cli-action

Github Action to build, package, and deploy serverless applications using the AWS SAM CLI.
18 stars 9 forks source link

Error: Missing option '--stack-name' #19

Closed GABAnich closed 3 years ago

GABAnich commented 3 years ago

I want to deploy my changes but got the error

Install aws-sam-cli latest
Successful install aws-sam-cli latest
cd ./
Run sam deploy --parameter-overrides TelegramToken=***
Usage: sam deploy [OPTIONS]
Try 'sam deploy --help' for help.

Error: Missing option '--stack-name', 'sam deploy --guided' can be used to provide and save needed parameters for future deploys.

stack-name is defined in samconfig.toml Would be good, if sam-cli-action can take this param from that file

GABAnich commented 3 years ago

samconfig.toml

version = 0.1
[default]
[default.deploy]
[default.deploy.parameters]
stack_name = "locash"
s3_bucket = "aws-sam-cli-managed-default-samclisourcebucket-1h8e2lfoc21uu"
s3_prefix = "locash"
region = "us-east-1"
confirm_changeset = false
capabilities = "CAPABILITY_IAM"
GABAnich commented 3 years ago

I added

- uses: actions/checkout@v2
### before
- uses: TractorZoom/sam-cli-action@master

And problem disappears

oyaaraas commented 3 years ago

@GABAnich can you explain where you added it? I have it in the beginning of the steps function, but I get the same problem

  steps:
  # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
  - uses: actions/checkout@v2
  # Prepare environment
  - name: Environment setup
    uses: actions/setup-node@v2
    with:
      node-version: '14.x'
  - run: npm --prefix ./oneid ci
  - name: Run tests
    run: npm --prefix ./oneid run test -- --coverage
  - name: SAM build
    uses: TractorZoom/sam-cli-action@master
    with:
      sam_command: "build"
    env:
      AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
      AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
  - name: SAM deploy
    uses: TractorZoom/sam-cli-action@master
    with:
      sam_command: "deploy"
    env:
      AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
      AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
GABAnich commented 3 years ago

@oyaaraas you did it right. I don't use TractorZoom. You can use this as an example