aws-actions / setup-sam

Action to set up AWS SAM CLI and add it to the PATH
Apache License 2.0
151 stars 23 forks source link

Runtime Node20.x support in github actions? #92

Closed mkkeems closed 10 months ago

mkkeems commented 10 months ago

@ssenchenko

With the new version of sam-cli pulled on my local machine, i'm able to successfully build sam apps with runtime set to nodejs20.x

However, the issue i'm having is when i try to deploy the sam app with github actions. Here is a bit of the github workflow pipline.yaml I have:

 build-and-deploy-dev:
    if: github.ref == 'refs/heads/dev'
    needs: [test]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: aws-actions/setup-sam@v2
        with:
          use-installer: true
      - run: sam build --template ${SAM_TEMPLATE} --use-container

..and so on. This is where i get the error in github actions:

Build Failed
Error: 'nodejs20.x' runtime is not supported

How should i update the .github/workflows/pipeline.yaml file in order for the sam app to be successfully built when the runtime is set to nodejs20.x in the template.yaml?

mkkeems commented 10 months ago

Ahh, the issue was not with aws-actions/setup-sam@v2.

After updating the following actions, I was able to successfully deploy the sam-app via github actions with runtime set to nodejs20.x

...
    steps:
      - uses: actions/checkout@v4
      - uses: aws-actions/setup-sam@v2
        with:
          use-installer: true
      - run: sam build --template ${SAM_TEMPLATE} --use-container

      - name: Assume the dev pipeline user role
        uses: aws-actions/configure-aws-credentials@v4
...

Cheers! 😄