aws-samples / aws-samples/aws-sam-github-actions-example

Action fails when there are no SAM changes

オープン
#10 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
Python
スター
63
フォーク
40
PR マージ指標
30日以内にマージされた PR はありません

説明

**Describe the bug**
When a change is pushed to main which doesn't update the SAM template, the deployment job will fail.

**To Reproduce**
Steps to reproduce the behavior:
The previous workflow must have completed successfully, and the repo hasn't been updated.
1. Go to Actions
2. Click on workflow "SAM Validate, Build, Test, Deploy"
3. Choose "Re-run jobs"

This job will fail

**Expected behavior**
The running job should succeed

**Screenshots**
Step "SAM deploy" fails with the following error:
![image](https://user-images.githubusercontent.com/985549/121764600-5e1ccf00-cb84-11eb-9a05-d2139f066609.png)
(note that I ran this from my own fork, so the stack name is different to what you will expect)

A possible fix: Change the last command in template.yml to the following:

sam deploy --template-file .aws-sam/build/template.yaml \
--stack-name ${{ steps.vars.outputs.environment }} \
--s3-bucket ${{ steps.vars.outputs.environment }} \
--parameter-overrides \
'ParameterKey=Name,ParameterValue=example \
ParameterKey=Version,ParameterValue=${{ steps.vars.outputs.version }}' \
--capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM \
|| echo "Nothing to deploy, no changes"

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。