From 1adc080b82476288804c41c553c5e2ad86f28298 Mon Sep 17 00:00:00 2001 From: Jacob Fuss <32497805+jfuss@users.noreply.github.com> Date: Thu, 11 May 2023 11:34:06 -0500 Subject: [PATCH] fix: Allow SAM-T version update GHA to get latest tag (#5154) 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 --- .github/workflows/automated-updates-to-sam-cli.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/automated-updates-to-sam-cli.yml b/.github/workflows/automated-updates-to-sam-cli.yml index dced649115..910ba0760c 100644 --- a/.github/workflows/automated-updates-to-sam-cli.yml +++ b/.github/workflows/automated-updates-to-sam-cli.yml @@ -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 @@ -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