Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
aws-actions

GitHub Action

Setup AWS SAM CLI

v0 Pre-release

Setup AWS SAM CLI

aws-actions

Setup AWS SAM CLI

Setup AWS SAM CLI and add it to the PATH

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Setup AWS SAM CLI

uses: aws-actions/setup-sam@v0

Learn more about this action in aws-actions/setup-sam

Choose a version

setup-sam

Tests CodeQL

Action to setup AWS SAM CLI and add it to the PATH.

Requires Python 3.6+.

Note: setup-sam is currently in v0, so while unlikely, we might introduce breaking changes until v1.

Example

Assuming you have a samconfig.toml at the root of your repository:

on:
  push:
    branches:
      - main
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
      - uses: aws-actions/setup-sam@v0
      - uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws-region: us-east-2
      # Build inside Docker containers
      - run: sam build --use-container
      # Prevent prompts and failure when the stack is unchanged
      - run: sam deploy --no-confirm-changeset --no-fail-on-empty-changeset

Inputs

version

The AWS SAM CLI version to install. Installs the latest version by default.

python

The Python interpreter to use for AWS SAM CLI. Defaults to python on Windows, and python3 otherwise.

Security

See CONTRIBUTING.md for more information.

License

This project is licensed under the Apache-2.0 License.