Action to set up AWS SAM CLI and add it to the PATH.
This action enables you to run AWS SAM CLI commands in order to build, package, and deploy serverless applications as part of your workflow.
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@v6
- uses: aws-actions/setup-sam@v3
with:
use-installer: true
- uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: ${{ secrets.ASSUME_ROLE_ARN }}
role-session-name: ci
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-changesetSee AWS IAM best practices for handling AWS credentials.
The AWS SAM CLI version to install. Installs the latest version by default.
Note
This is the recommended approach on supported platforms. It does not require Python to be installed, and is faster than the default installation method.
Currently supports Linux x86-64 and aarch64 (ARM) runners. For ARM architecture, only versions 1.104.0 and above are supported. Set to
trueto set up AWS SAM CLI using a native installer. Defaults tofalse.
Note
Unused if
use-installeris set totrue.
The Python interpreter to use for AWS SAM CLI. Defaults to python on Windows, and python3 otherwise.
You can use actions/setup-python to automatically set up Python.
The GITHUB Authentication token used to call the GITHUB release APIs, which use-installer: true reads to resolve the version to install and to obtain the published archive digest it verifies against.
On github.com this defaults to the job's GITHUB_TOKEN, so the per-repository rate limit applies rather than the much smaller unauthenticated limit, which is shared per IP across runners. You do not normally need to set it.
The parameter can accept either GITHUB_TOKEN or a PAT (Personal Access Token).
See CONTRIBUTING.md for more information.
This project is licensed under the Apache-2.0 License.