Skip to content

a GitHub Action that allows you to use the serverless CLI inside of GitHub Actions

License

Notifications You must be signed in to change notification settings

kaskadi/action-slscli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build status Static code analysis status Docs generation status

CodeClimate


What is this action for?

This action allows you to use the Serverless CLI inside of GitHub Actions.

How to use it?

You can use the following code as a new GitHub Actions Workflow:

name: {YOUR-ACTION-NAME}
on: [{YOUR-ACTION-EVENT}]
jobs:
  {YOUR-JOB-NAME}:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: {YOUR-STEP-NAME}
      uses: kaskadi/action-slscli@master
      with:
        command: {COMMAND-VALUE}
        working_directory: {WORKING_DIRECTORY-VALUE}
        should_throw: {SHOULD_THROW-VALUE}
      env:
        AWS_ACCESS_KEY_ID: {AWS_ACCESS_KEY_ID-VALUE}
        AWS_SECRET_ACCESS_KEY: {AWS_SECRET_ACCESS_KEY-VALUE}

Note: everything contained in single curly brackets ({ }) needs to be replaced by your desired values

Inputs:

Input Required Default Description
command false --version Command to be run by Serverless
working_directory false Directory in which Serverless should run
should_throw false Define whether the action process should throw an error on Serverless error (exit code 1)

Environment variables:

Variable Required Description
AWS_ACCESS_KEY_ID true ID of a programmatic access AWS key attached to an IAM role which has required permissions to work with the Serverless configuration you defined. Recommend implementing into repository secrets!
AWS_SECRET_ACCESS_KEY true Secret of a programmatic access AWS key attached to an IAM role which has required permissions to work with the Serverless configuration you defined. Recommend implementing into repository secrets!

Attention: this action does not include error handling to avoid blocking a workflow because of a non blocking error thrown by Serverless. For example Invalid stage identifier errors which occur when deploying an API without resources but does not prevent the API from effectively being created.

You are therefore responsible for ensuring that your Serverless configuration files are exempt of error (hint: you can use sls deploy --noDeploy command locally to see any error that may occur).

About

a GitHub Action that allows you to use the serverless CLI inside of GitHub Actions

Topics

Resources

License

Stars

Watchers

Forks