Skip to content

Commit

Permalink
fix: Allow SAM-T version update GHA to get latest tag (aws#5154)
Browse files Browse the repository at this point in the history
There are two issues this patch fixes:
1) the sed for updating the SAM-T version was flipped causing an invalid
base.txt
2) The default fetch depth is 1 causing only the latest commit to be pulled.
For some reason, this causes the tag "git describe" returns nothing. With a
fetch depth of 0, we get the right value.

Co-authored-by: Jacob Fuss <jfuss@users.noreply.github.com>
  • Loading branch information
jfuss and jfuss committed May 11, 2023
1 parent ef2138d commit 1adc080
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/automated-updates-to-sam-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
repository: aws/serverless-application-model
path: serverless-application-model
ref: main
fetch-depth: 0

- name: Checkout SAM CLI
uses: actions/checkout@v3
Expand All @@ -81,11 +82,13 @@ jobs:
git config --global user.name "GitHub Action"
cd serverless-application-model
SAM_T_CUR_VERSION=$(git describe --tags --abbrev=0 | sed 's/v//')
echo "SAM-T cur version is $SAM_T_CUR_VERSION"
cd ../aws-sam-cli
git checkout -b update_sam_transform_version
SAM_T_PRE_VERSION=$(grep "aws-sam-translator=" requirements/base.txt)
echo "SAM-T pre version is $SAM_T_PRE_VERSION"
git reset --hard develop
sed -i "s/aws-sam-translator=$SAM_T_CUR_VERSION/$SAM_T_PRE_VERSION/g" requirements/base.txt; make update-reproducible-reqs
sed -i "s/$SAM_T_PRE_VERSION/aws-sam-translator==$SAM_T_CUR_VERSION/g" requirements/base.txt; make update-reproducible-reqs
cp -r ../serverless-application-model/tests/translator/input ./tests/functional/commands/validate/lib/models
git status
git diff --quiet && exit 0 # exit if there is no change
Expand Down

0 comments on commit 1adc080

Please sign in to comment.